Your JSON and expressions never leave your browser; nothing you paste is uploaded. JSON numbers larger than 2^53 (9,007,199,254,740,992) lose precision, because browsers parse them as JavaScript numbers.
JSONPath syntax cheat sheet
$- The root of the document. Every expression starts here.
@- The current element inside a filter, as in
[?(@.price<10)].
..- Recursive descent: search at every depth, as in
$..price.
*- Wildcard: every key of an object or every item of an array.
[n]- One array item by index. Negative numbers count from the end.
[start:end]- An array slice. The end index is not included.
[?(...)]- A filter: keep only the items for which the condition is true.
[a,b]- A union: several indexes or key names at once.
Paste a JSON document, type a JSONPath expression, and every matching value appears as you type. One expression such as $.store.book[*].author can pull every author out of a deeply nested response without a loop. This page evaluates the expression locally, can show the full path of each match, and keeps your data in the browser.
What is JSONPath?
JSONPath is a query language for picking values out of a JSON document, the way XPath picks nodes out of XML. An expression starts at the root with $, then walks keys, array indexes, wildcards and filters. It returns every matching value as a list, which makes it handy for inspecting large responses.
Stefan Goessner proposed JSONPath in 2007, and for years it existed as a convention that each library implemented a little differently. In 2024 the IETF published a standard version as RFC 9535. The engine on this page is the open-source jsonpath-plus library, which follows the original Goessner-style syntax and adds a few extensions, so treat this page as a practical tester rather than a conformance checker for the RFC.
Where JSONPath shows up
You will meet JSONPath in everyday tools. The command kubectl get pods -o jsonpath='{.items[*].metadata.name}' uses a JSONPath template to print only the field you ask for instead of a full dump of every pod. Postman's response pane has a Filter button that accepts a JSONPath expression, so you can narrow a long response down to the part you care about.
JSONPath dialects differ
Not every tool that says "JSONPath" means exactly the same thing, so do not assume an expression will work unchanged somewhere else. kubectl uses its own template syntax: expressions sit inside curly braces, usually leave out the leading $, and can loop with range and end. REST Assured's JsonPath class uses Groovy's GPath, so a query looks like store.book.author rather than $.store.book[*].author. JMESPath, which the AWS CLI uses, and jq are separate query languages with their own syntax. Test the idea here, then check the documentation of the tool you will actually run it in.
How do I filter an array by value in JSONPath?
Use a filter expression inside square brackets, such as [?(@.price<10)]. The @ symbol stands for each element of the array, and only the elements where the condition is true are kept. $.store.book[?(@.price<10)] returns every book cheaper than 10. Add .title to return just that field.
Comparisons, existence checks and combined conditions
Filters accept the usual comparison operators: ==, !=, <, <=, > and >=. Quote string values, as in [?(@.category=='fiction')]. Join conditions with && and ||, and test whether a key exists with [?(@.isbn)], which keeps only the books that have an ISBN. If an expression returns nothing, check the key spelling first, because a path that does not exist simply produces no matches rather than an error.
Worked examples on the bookstore JSON
Each example below uses the sample document that the Load sample JSON button inserts, and every result was copied from this tool rather than written by hand. If you are not sure which keys a payload contains, generate a structure first with the JSON Schema Generator, then write the path against it.
List every author
Expression
$.store.book[*].author
Result
[
"Nigel Rees",
"Evelyn Waugh",
"Herman Melville",
"J. R. R. Tolkien"
]
Filter by price and return only titles
Expression
$.store.book[?(@.price<10)].title
Result
[
"Sayings of the Century",
"Moby Dick"
]
Search at every depth with ..
Recursive descent finds a key wherever it appears, so the bicycle price is included alongside the book prices.
Expression
$..price
Result
[
8.95,
12.99,
8.99,
22.99,
19.95
]
Show where each match lives
Turn on Show paths to get the location of every match next to its value. This is useful when a recursive search finds a key in more than one place and you need to know which is which.
Expression (with Show paths on)
$..isbn
Result
[
{
"path": "$['store']['book'][2]['isbn']",
"value": "0-553-21311-3"
},
{
"path": "$['store']['book'][3]['isbn']",
"value": "0-395-19395-8"
}
]
How to use this JSONPath tester
- Add your JSON by pasting it into the input box, or click Load sample JSON to try the bookstore document. If the JSON is malformed, the tool reports the line and column; fix it there or run it through the JSON Formatter first.
- Type an expression that starts with
$. Results update about 300 milliseconds after you stop typing. Press Run or hit Enter in the expression field to evaluate immediately.
- Click an example to fill the expression field with a ready-made query and run it against the sample or your own JSON.
- Show paths switches the results from bare values to pairs of path and value, so you can see exactly where each match came from.
- Format input JSON re-indents the input so it is easy to read next to the results.
- Copy results puts the output array on your clipboard. If you want to see how two responses differ, run the same expression on each and compare the copies with Compare JSON.
- Large documents: above about 1 MB the live mode pauses to keep the page responsive. Press Run to evaluate when you are ready.
JSONPath syntax reference
These are the operators this tester understands, with an example for each against the bookstore JSON. Our guide to JSONPath expressions explains them in more depth.
JSONPath operators with meaning and example
| Operator | Meaning | Example |
$ | Root of the document | $.expensive |
@ | Current element inside a filter | $..book[?(@.price>20)] |
.key or ['key'] | Child key; brackets handle spaces and dots | $.store['bicycle'].color |
.. | Recursive descent through every level | $..author |
* | Wildcard for all keys or items | $.store.* |
[n] | Array item by index; negative counts from the end | $.store.book[0] |
[start:end] | Array slice, end not included | $.store.book[1:3] |
[a,b] | Union of indexes or keys | $..book[0,1] |
[?(...)] | Filter by condition | $.store.book[?(@.category=='fiction')] |
Is my JSON uploaded when I use this tester?
No. Your JSON and expressions never leave your browser: evaluation runs on your device using a local copy of the open-source jsonpath-plus library, and nothing you paste is uploaded. The page uses Google Analytics only to count visits and clicks on buttons such as Run and Copy results, never what you paste or type.
Expressions are evaluated in the library's safe mode, which interprets filter conditions with a restricted built-in evaluator instead of running them as JavaScript, so an expression copied from an untrusted source cannot execute code on the page.