JSONPath Tester

Write a JSONPath expression and see every matching value and its location in your JSON instantly. Filters, slices and recursive descent are supported, and nothing is uploaded.

Loading the tool. It runs entirely in your browser...

JSONPath syntax at a glance

JSONPath is to JSON what XPath is to XML: a short expression that selects values from a document. It always starts with $, the root, followed by steps.

  • $.store.book or $['store']['book']: child by name.
  • [0], [-1], [0,2]: array items by index; negative counts from the end.
  • [1:3], [::2]: slices with start, end and step.
  • [*] or .*: every child.
  • ..price: recursive descent, finds price at any depth.
  • [?(@.price < 10)]: filter, where @ is the current item. Combine tests with &&, || and !, compare with ==, !=, <, >, =~ (regular expression) and use length(@.name).

The tester evaluates expressions with its own small parser. It never runs your expression as JavaScript, so a pasted path cannot execute code.

Worked example

Data:

{"store":{"book":[
  {"title":"Sayings","price":8.95},
  {"title":"Sword of Honour","price":12.99},
  {"title":"Moby Dick","price":8.99}
]}}

Expression $.store.book[?(@.price < 10)].title returns:

["Sayings", "Moby Dick"]

Each match is listed with its normalised location, for instance $['store']['book'][0]['title'], so you can see exactly where it came from. $..price returns all three prices, and $.store.book[-1:] returns the last book.

Differences between implementations

JSONPath was only standardised in 2024 (RFC 9535), and older libraries disagree on details such as filter syntax and what a missing property returns. This tester follows the common behaviour of the original proposal with RFC-style filters: a filter on a property that does not exist matches nothing, and results come back in document order. If a path works here but not in your language's library, check which dialect it implements, and see the JSON formatter to confirm the document structure first.

Frequently asked questions

Does it evaluate my expression as JavaScript?

No. Filters are parsed by a small built-in expression parser that supports comparisons and boolean operators only. Nothing is passed to eval or the Function constructor.

What does recursive descent do?

Two dots, as in $..price, search the whole document at any depth. It is handy when you do not know how deeply a field is nested.

Why do I get no matches?

Check names for exact case, make sure array steps apply to arrays, and remember that a filter on a missing property is false. Try simpler paths first, such as $.store, then add steps.

Can I share a query?

Yes. The share button puts the data and the expression into a link when they are small enough. Do not share links for private data.