DevToolPal
EN

JSONPath Evaluator

Run a JSONPath query against JSON and see every matching value and its path, with filters and functions (RFC 9535).

Runs locally, never uploaded

Options

Show

JSON

0 chars · 0 B

Matches

0 chars · 0 B

What it does

JSONPath is a query language for JSON, similar to what XPath is for XML. A query such as $.store.book[*].title walks into a document and selects the values you care about. This evaluator runs a JSONPath expression against the JSON you paste and lists every match as a JSON array: the matched values, their normalized paths (for example $['store']['book'][0]['title']), or both.

It follows RFC 9535, the IETF standard published in 2024, so the results match modern libraries in JavaScript, Java, Python, Go and other languages. Use it to try out a query before you put it in code, to debug why a filter returns nothing, or to pull a few fields out of a large API response.

How to use

  1. Paste JSON into the JSON box, upload a .json file, or click Sample to load the classic bookstore document.
  2. Type a query in JSONPath expression. The matches update as you type.
  3. Choose Show: values, paths, or path/value pairs.
  4. Copy or download the result. Syntax errors in the query point to the character where parsing failed.

Syntax cheat sheet

ExpressionMeaning
$The root of the document
.name or ['name']A member of an object
[0], [-1]An array element (negative counts from the end)
[1:3], [::2]A slice: start, end (exclusive) and step
*Every member or element
..namename at any depth
[?@.price < 10]Children for which the filter is true; @ is the current item

Filters can combine conditions with &&, || and !, compare against other parts of the document with $, and call functions: length(@.tags) > 2, count(@.items[*]) == 0, match(@.code, '[A-Z]{3}') for a full regular-expression match, and search(@.title, 'Ring') for a match anywhere in the string.

Example

With the sample bookstore, this query selects the titles of books cheaper than 10:

$.store.book[?@.price < 10].title

and returns:

["Sayings of the Century", "Moby Dick"]

Change it to $..book[?@.isbn].author to list the authors of books that have an ISBN, or $..price to collect every price in the store, including the bicycle’s.

FAQ

› Which JSONPath syntax is supported?

The standard syntax of RFC 9535: dot and bracket member names, wildcards, array indexes (including negative ones), slices, descendant search with .., filters with comparisons and && || !, and the functions length(), count(), match(), search() and value(). The older style ?(@.price < 10) also works because the parentheses are just grouping.

› Why does my query return an empty array?

An empty array means the query is valid but nothing matched. Check member names (they are case-sensitive), whether a value is an array or an object, and switch Show to Paths on a broader query such as $..* to see what the document contains.

› Can I use script expressions like [(@.length-1)]?

No. Script expressions run arbitrary code and are not part of the standard. Use a negative index instead: [-1] is the last element and [-2:] the last two.

› Is my JSON sent to a server?

No. The query is parsed and evaluated in your browser by the page's own code; nothing is uploaded.