JSONPath Tester
Paste JSON, write a JSONPath expression and see every value it selects together with its exact path. The tool follows the JSONPath standard (RFC 9535), including filters such as [?(@.price < 10)], slices and wildcards. Queries are parsed and evaluated by walking your data: nothing is ever executed, and nothing is uploaded.
Result
Examples
Queries you can try on the sample data:
| Expression | Selects |
|---|---|
$.store.book[*].author | All authors |
$..price | Every price anywhere |
$..book[?(@.price < 10)].title | Titles of books under 10 |
$..book[?(@.isbn)].title | Titles of books that have an ISBN |
$.store.book[-1:] | The last book |
$..book[0,1].title | The first two titles |
$.store.book[?(length(@.title) > 15)].title | Titles longer than 15 characters |
Formula & Methodology
The expression is parsed into steps (children, descendants, names, indexes, slices and filters) and evaluated against your JSON by walking it, following RFC 9535. Results come back in document order together with their normalized paths, such as $['store']['book'][0].
| Syntax | Meaning |
|---|---|
$ | The root of the document |
@ | The current node inside a filter |
.name or ['name'] | A member by name |
[0] [-1] | An array element by position; a negative number counts from the end |
* | Every member or element |
.. | Search at any depth (descendants) |
[1:3] [::2] | A slice: start to end (not included), with an optional step |
[a,b] | A union of several names or indexes |
[?(@.x > 1)] | A filter: keeps the children for which the condition is true |
&& || ! | Combine conditions with and, or, not |
length() count() value() | Functions: length of a string, array or object; number of nodes; the single value of a path |
Numbers are shown exactly as written in your JSON, and when a key is repeated the last value is used, as JSON parsers do.
Notes and limitations
- Nothing is executed. Script expressions such as [(@.length-1)] and the regex functions match() and search() are not supported and are reported as errors.
- Comparisons follow the standard: values of different types are never equal, < and > only compare two numbers or two strings, and a missing value equals only another missing value.
- Filters can only compare paths that select one value (names and indexes). Use exists tests such as ?(@.isbn) for anything else.
- Very large documents or queries that would visit more than 5,000,000 nodes are stopped with an error; at most 10,000 matches are kept.
- Other JSONPath libraries differ in older, non-standard features (for example script expressions and $.. quirks), so results can differ from tools that predate RFC 9535.
How to Use
- Paste your JSON in the first box.
- Type a JSONPath expression, or choose an example query.
- Read the number of matches, the matched values and the path of each one.
- If the expression or the JSON is invalid, the message shows where the problem is.
- Copy the values or the paths.
Frequently Asked Questions
Is my JSON uploaded?
No. The query runs in your browser on text that never leaves the page. Nothing you enter is sent to ToolQuarter, analytics or any other service.
Is it safe to use a filter expression from somebody else?
Yes. The filter is a small language of comparisons that this tool parses itself; it cannot run code, call functions you did not choose or reach the network.
What does .. mean?
The descendant segment: $..price finds every “price” member at any depth below the root, not only direct children.
Why does my script expression such as [(@.length-1)] fail?
Script expressions come from an older, non-standard JSONPath and need to evaluate code, which this tool never does. Use [-1] for the last element, or a filter such as ?(@.price < 10).
Which JSONPath version does this implement?
The IETF standard, RFC 9535, with names, indexes, wildcards, slices, unions, filters, the descendant segment and the functions length(), count() and value().
Last updated: