JSONPath Generator

Paste JSON on the left and click nodes in the structure tree. The JSONPath appears in the path bar at the bottom of the right pane—copy it and run it in the JSONPath tester to fetch values.

About this JSONPath generator

Paste JSON on the left. The structure tree on the right follows that document—expand nodes, click a field or index, and the JSONPath appears in the path bar at the bottom of the right pane. Copy it, then open the JSONPath tester with the same JSON to run the expression and read values as a JSON array.

The generator only builds the path string; it does not filter or extract data. Plain keys use dot notation ($.order.items), array indexes use brackets ([0]), and awkward key names use quoted segments ($['a.b']).

How clicking builds a path

Structure tree

Each row is one value in the parsed JSON. Use the arrow to open objects and arrays. Click the node label (including $ for the root) to select it. Expand all / Collapse all help on large payloads.

Path output bar

After you click a node, one RFC 9535-style JSONPath is shown in the bottom bar on the right. Copy from the icon or by clicking the path field. The hint above that bar explains that you can select $ or any field or index.

Generator vs tester

Use this page when you know the JSON but not the path. Use the JSONPath tester when you already have an expression and want every matching value in one array.

When keys need quotes

Identifiers made of letters, digits, and underscore continue with a dot. Keys that contain dots, spaces, hyphens, or non-ASCII characters are emitted as $['key'] so the path stays a single segment.

Typical use

API response — copy $.items[*].id

Paste a REST or GraphQL JSON body, drill into items, click id on one row or on the array node, and copy the generated path instead of counting brackets by hand.

Config files — nested settings

For deeply nested config JSON, expand the branch you care about and click the leaf. Paste the path into scripts, jq-style tools, or the tester to verify it returns the value you expect.

Frequently asked questions

What is a JSONPath generator used for?
It turns a JSON document into a correct JSONPath expression by clicking nodes in a tree—useful when you can see the data but do not want to hand-type $.store.book[0].title. The output is a path string you can copy into code, docs, or the JSONPath tester.
How do I generate JSONPath online by clicking?
Paste JSON on the left, wait for the tree on the right, then click $ or any field or array index. The path appears in the bottom bar on the right. Example: clicking order then id yields $.order.id; clicking the first array element adds [0].
What is the difference between this generator and the JSONPath tester?
The generator writes the path from your clicks. The JSONPath tester runs a path you type or paste and returns all matching values in one JSON array. Many workflows: generate here, then test there with the same JSON.
Why does my generated path use quotes around a key?
Dot notation only works for simple identifier keys. If a key contains a dot, space, or special characters, the tool emits bracket notation with quotes—e.g. $['meta.version']—so parsers treat it as one key, not two nested levels.
Can I use the generated path in code or Postman?
Yes. The path follows common JSONPath syntax (root $, dot keys, bracket indexes). Always confirm against your library’s dialect; then run it in the tester on sample JSON before production.
What if the JSON is invalid or the tree is empty?
Invalid JSON shows an error under the input and the tree stays empty. Trailing commas, comments, and single quotes are not JSON—use JSON repair & validate first, then paste again and click the tree.
Does editing JSON reset the path?
When the parsed structure changes, the previously selected path is cleared so you do not copy a path that no longer matches the document. Click a node again after edits.