JSON Path Finder
Shows your JSON as a tree. Click any value to get its path, in six styles, or run a JSONPath query and see every match highlighted.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
The tree appears here.
How to Use JSON Path Finder
- Paste or open your JSON. The tree on the right builds itself as you type. A JSON error shows its line and column.
- Click any line in the tree. Its path appears underneath. Pick a Path style for JSONPath, JavaScript, Python, PHP or jq.
- Copy the path or press Query it. Query it runs the path in the JSONPath box below.
- Write your own query. Type an expression such as $..book[[email protected] < 10].title, or press one of the examples. Matches are listed and highlighted in the tree.
- Copy the results. Copy matches as JSON gives an array of the values; Copy paths gives one path per line.
Example: getting the path to one value
The Sample button loads the bookstore document that Stefan Goessner used when he first described JSONPath in 2007. It has four books and a bicycle. Click "title": "Moby Dick" in the tree and the path appears under it. Change Path style to get the same location written for your language:
| Path style | Path to “Moby Dick” |
|---|---|
| JSONPath, dot notation | $.store.book[2].title |
| JSONPath, bracket notation | $['store']['book'][2]['title'] |
| JavaScript | data.store.book[2].title |
| Python | data["store"]["book"][2]["title"] |
| PHP | $data['store']['book'][2]['title'] |
| jq | .store.book[2].title |
Query it copies the path into the JSONPath box and runs it, which returns exactly that one value. Switch to All paths to list every value in the file as path = value lines that you can filter, copy or download.
JSONPath cheat sheet
Every result below comes from running the expression in this tool on the sample. We also ran each one through a separate implementation of RFC 9535 (the jsonpath-rfc9535 library for Python) and got the same results. $..* returns 27 nodes on the sample in both.
| Expression | What it selects | Result on the sample |
|---|---|---|
$.store.book[0].title |
A child by name, then an array item by index (counting from 0) | "Sayings of the Century" |
$['store']['bicycle']['color'] |
The same idea in bracket notation, needed for keys with spaces or dashes | "red" |
$.store.book[*].author |
Every item of an array with the * wildcard | ["Nigel Rees", "Evelyn Waugh", "Herman Melville", "J. R. R. Tolkien"] |
$..author |
Every author key at any depth (recursive descent) | ["Nigel Rees", "Evelyn Waugh", "Herman Melville", "J. R. R. Tolkien"] |
$..price |
Every price, in books and in the bicycle | [8.95, 12.99, 8.99, 22.99, 399] |
$.store.book[-1].title |
The last item, with a negative index | "The Lord of the Rings" |
$.store.book[0,1].title |
Several items at once (a union) | ["Sayings of the Century", "Sword of Honour"] |
$.store.book[:2].title |
A slice: items 0 and 1, the end index is not included | ["Sayings of the Century", "Sword of Honour"] |
$.store.book[::-1].title |
A slice with step -1: the array in reverse | ["The Lord of the Rings", "Moby Dick", "Sword of Honour", "Sayings of the Century"] |
$..book[[email protected]].title |
A filter that keeps items where a key exists | ["Moby Dick", "The Lord of the Rings"] |
$..book[[email protected] < 10].title |
A filter with a comparison | ["Sayings of the Century", "Moby Dick"] |
$..book[[email protected] > 10 && @.category == 'fiction'].title |
Two conditions joined with && (|| means or) | ["Sword of Honour", "The Lord of the Rings"] |
$..book[?length(@.title) > 15].title |
A function: length() of a string, array or object | ["Sayings of the Century", "The Lord of the Rings"] |
$..book[?match(@.author, 'J.*')].author |
match() tests a regular expression against the whole value | "J. R. R. Tolkien" |
$..book[?search(@.title, 'of')].title |
search() finds a regular expression anywhere in the value | ["Sayings of the Century", "Sword of Honour", "The Lord of the Rings"] |
How it works
- The query box follows RFC 9535, the JSONPath standard the IETF published in February 2024: names, wildcards, indexes, negative indexes, slices, unions, recursive descent with
.., filters with?, and the functionslength(),count(),match(),search()andvalue(). - The older filter style
[?(@.price < 10)]from Goessner’s article and many libraries also works, because the brackets around a filter are allowed. - Comparisons follow the standard. Numbers compare with numbers and strings with strings; mixing them is simply false. A missing key equals another missing key, so
@.a == @.bis true when both are absent. - Results are listed in document order with their normalized path, such as
$['store']['book'][2]['title'], which is the form RFC 9535 defines for pointing at one exact node. - Paths from the tree are written with dots where a name allows it and with brackets and quotes where it does not, for example
$.user['first name']ordata["e-mail"].
Limits
- Some libraries add features that are not in RFC 9535, such as script expressions
[(@.length-1)],inoperators or@.lengthon arrays. These give a syntax error here; use[-1]andlength(@)instead. - Regular expressions in
match()andsearch()use your browser’s JavaScript engine, which accepts a little more than the I-Regexp subset the standard asks for. - Numbers beyond about 15 to 17 significant digits are rounded, because the JSON is read with the browser’s standard parser.
- The tree shows the first 5,000 lines. All paths, filters and queries still cover the whole file. Files open up to 20 MB.
Frequently asked questions
What does $ mean in JSONPath?
It is the root of the document, the outermost object or array. Every JSONPath starts with it. Inside a filter, @ stands for the item being tested, so $.store.book[[email protected] < 10] keeps the books whose own price is under 10.
What is the difference between . and .. in JSONPath?
A single dot moves one level down to a named child, so $.store.bicycle means exactly that bicycle. Two dots search every level below, so $..price finds all 5 prices in the sample, four in books and one in the bicycle.
How do I write a key that has a space or a dash?
Use bracket notation with quotes: $['first name'] or $.user['e-mail']. A name after a dot can only hold letters, digits and _. If you type $.first-name, the tool shows “Names with "-" need bracket notation: ['first-name'].”
Is JSONPath the same as jq or JSON Pointer?
No. jq is a full command-line language with its own syntax, such as .store.book[0].title. JSON Pointer (RFC 6901) is a fixed path written like /store/book/0/title with no wildcards or filters. JSONPath sits in between: it selects one or many values but does not transform them.
Related Tools
Android AssetLinks JSON Generator - App Links →
Android AssetLinks JSON Generator files for Android App Links. Configure package names and SHA-256…
Convert BSON to JSON →
Convert MongoDB BSON hex dumps to readable JSON in your browser. Free, offline, client-side…
Csharp Class from JSON →
Convert JSON to C# class - records or classes, JsonPropertyName (System.Text.Json or Newtonsoft.Json), init-only…
CSS Clip Path Generator →
Builds clip-path shapes visually: drag the points of a polygon, resize a circle or…
Go Struct from JSON →
Generate typed Go structs from a JSON sample, with exported field names and json…
JSON Diff →
Compare two JSON values and see exactly what changed, listed by path.
JSON Escape and Unescape →
Turns any text into a valid JSON string, or decodes an escaped JSON string…
JSON Flattener →
Flatten nested JSON into a single level, using dot-notation keys for every nested value.
JSON Formatter and Validator →
Paste JSON to format or minify it. Errors are shown with the line, column…
JSON to GraphQL Schema →
Generate a GraphQL schema from a JSON sample, with types inferred and nested objects…
JSON to Java POJO →
Generate Java POJO classes from a JSON sample, with field types inferred and nested…
JSON to PHP Array →
Convert JSON into an equivalent PHP array literal, using modern short array syntax.