Find any path with the JSON path finder
The JSON path finder turns a pasted document into a clickable tree. Select any node, whether a leaf value, an object or an array, and the tool shows its path in six syntaxes at once, together with the node's value. It saves you from counting array indexes by hand in a long API response or guessing how to quote a key that contains spaces.
Six path syntaxes, one click
For this sample:
{
"store": {
"books": [ { "title": "Dune", "price": 9.99 } ],
"open hours": { "mon-fri": "9-18" }
}
}
Clicking "Dune" and then "9-18" gives:
| Syntax | Path to "Dune" | Path to "9-18" |
|---|---|---|
| JSONPath | $.store.books[0].title | $.store['open hours']['mon-fri'] |
| JavaScript | data.store.books[0].title | data.store["open hours"]["mon-fri"] |
| Python | data["store"]["books"][0]["title"] | data["store"]["open hours"]["mon-fri"] |
| PHP | $data['store']['books'][0]['title'] | $data['store']['open hours']['mon-fri'] |
| jq | .store.books[0].title | .store["open hours"]["mon-fri"] |
| JSON Pointer | /store/books/0/title | /store/open hours/mon-fri |
Keys that are valid identifiers use dot notation; keys with spaces, hyphens or leading digits switch to bracket notation automatically, with the quoting each language expects. The variable names data and $data are placeholders; replace them with your own.
When each syntax is useful
- JSONPath for API testing tools, Kubernetes
kubectl -o jsonpathand data mappers. Test full expressions with filters in the JSONPath tester. - JavaScript, Python and PHP to paste straight into code that reads a decoded response.
- jq for shell pipelines such as
curl … | jq '.store.books[0].title'. - JSON Pointer for JSON Schema
$refvalues and thepathfield of JSON Patch operations. Slashes in keys become~1and tildes become~0.
Working with large documents
The tree updates as you type. Objects show their key count and arrays their length, like {3} or [25], so you can see structure at a glance. Type in the filter box to hide branches that do not contain your search text, which is the fastest way to locate a field such as email in a response with hundreds of lines.
You can also click an object or array node rather than a leaf. The paths then point at the whole container, and the Value row shows its JSON (shortened after about 300 characters), which helps when you need the path to a list you plan to loop over, such as $.store.books.
Copy all paths copies the JSONPath of every leaf value, one per line. That list is handy for documenting an API response, writing assertions for every field, or checking which fields exist before mapping them to a database.
Edge cases
- The root is selectable: it is
$in JSONPath,.in jq and the empty string in JSON Pointer. - Quotes inside keys are escaped in the single-quoted JSONPath and PHP forms, for example
['it\'s']. - Empty objects and arrays appear as nodes too, so you can still copy their paths.
- Invalid JSON clears the tree and shows the parser error. Fix it with the JSON formatter first if the document is minified or broken.
Privacy
Parsing and path generation happen in your browser. The JSON you paste, which often includes tokens or personal data from real API responses, is not uploaded.