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.

Processed locally in your browser. Your data is not uploaded to our servers.

Your JSON stays in this page: it is never uploaded or sent to analytics.

It starts with $ (the whole document). For example $.store.book[0].title

Result

Examples

Queries you can try on the sample data:

ExpressionSelects
$.store.book[*].authorAll authors
$..priceEvery price anywhere
$..book[?(@.price < 10)].titleTitles of books under 10
$..book[?(@.isbn)].titleTitles of books that have an ISBN
$.store.book[-1:]The last book
$..book[0,1].titleThe first two titles
$.store.book[?(length(@.title) > 15)].titleTitles 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].

SyntaxMeaning
$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

  1. Paste your JSON in the first box.
  2. Type a JSONPath expression, or choose an example query.
  3. Read the number of matches, the matched values and the path of each one.
  4. If the expression or the JSON is invalid, the message shows where the problem is.
  5. 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: