JSONPath Tester

Test JSONPath expressions against JSON data in real time. View matched results with syntax highlighting. Supports filters, wildcards, and recursive descent. Free, browser-based.

  • Runs in your browser
  • Your data never leaves your browser
  • Free · No Sign-Up
Start with $. Queries run when either input changes. RFC 9535 selectors include wildcards, negative indexes, slices and filters. Unsupported syntax shows its character position; an empty expression clears the results.
Examples
Open Examples and choose a query. It replaces only the expression and runs on your current JSON; it does not reload the bookstore sample. Closing Examples keeps the expression unchanged.
Edit the preloaded bookstore JSON or paste your own JSON value. Queries update as you type. Numbers use JavaScript precision. Ctrl+L (⌘+L on Mac) inside this tool clears both inputs and the results.

Enter JSON and a JSONPath expression to see matching values.

Results Results show matched values, without normalized paths. One match is shown as its value; multiple matches form a JSON array. No matches and invalid input have separate messages. Long results scroll inside this panel. Copy takes the complete displayed JSON, including quotes around a single string and two-space indentation. Copy is unavailable for errors or no matches. If copying fails, click Copy again to retry.
Read the full guide JSONPath: RFC 9535 Syntax and How Libraries Differ (Tested)
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.

JSONPath Syntax Reference (RFC 9535)

  • $ — root of the document
  • .key, ['key'], ["key"] — member of an object
  • [n], [-1] — array element; negative indexes count from the end
  • [start:end:step] — slice, for example [0:2], [1:], [::-1]
  • [0,2], ['title','price'] — several selectors in one bracket; results follow the order of the selectors
  • [*], .* — all array elements or object member values
  • ..key, ..[0], ..* — descendants at any depth
  • [?@.price < 10] — filter; also written [?(@.price < 10)]
  • [?@.isbn], [?!@.isbn] — members that exist / do not exist
  • [?@.a.b == 'x' && @.c > $.min] — nested paths, && || !, and absolute $ paths inside a filter
  • length(), count(), match(), search(), value() — the five functions defined by RFC 9535

Limitations

  • Syntax outside RFC 9535 is rejected with “Unsupported syntax” and the character position: script expressions [(...)], =~, in / nin, and extensions such as ~ for member names from other libraries.
  • $.store.book.length selects a member named length, which arrays do not have, so the result is empty. Use length() inside a filter, for example $[?length(@.book) > 3].
  • Results list the matched values. Normalized paths (such as $['store']['book'][0]) are not shown.
  • Object members are returned in the order they appear in your JSON. RFC 9535 leaves this order open, so other implementations can return them in a different order.
  • match() and search() run the pattern as a JavaScript regular expression with the u flag after changing . to [^\n\r] (RFC 9485 §5.3). Patterns that JavaScript rejects give false; JavaScript-only syntax such as \d or lookahead is accepted.
  • Numbers are JavaScript numbers after JSON.parse, so integers above 253 lose precision before they are compared.

Examples on the Sample Data

The page opens with a small bookstore document: four books and a bicycle. These are the tool’s results for it:

ExpressionResult
$.store.book[?@.price < 10].title["Sayings of the Century", "Moby Dick"] (2 matches)
$.store.book[-1].author"J. R. R. Tolkien" (1 match)
$..price[8.95, 12.99, 8.99, 22.99, 19.95]: the four book prices, then the bicycle
$.store.book[?@.isbn].titleNo matches found: no book in the sample has an isbn member
$.store.book[(@.length-1)]Unsupported syntax: script expressions such as [(@.length-1)] are not part of RFC 9535; use a negative index such as [-1] (at character 14)

When exactly one value matches, the Results panel shows that value on its own; with two or more, it shows a JSON array. Copy takes the panel as shown, so a single string is copied with its quotes. Results are pretty-printed with two-space indentation.

Other JSONPath Dialects

Many tools say “JSONPath” but implement a different language. An expression that works here may need changes elsewhere, and the reverse:

  • kubectl uses JSONPath templates: the expression goes inside braces, the leading $ is optional, and there are extra keywords such as range and end, as in kubectl get pods -o jsonpath='{.items[*].metadata.name}'. Paste only the part inside the braces here, with $ added in front.
  • Jayway JsonPath (Java) and libraries based on Stefan Goessner’s 2007 article accept script expressions, the =~ regex operator and functions such as .length() at the end of a path. This tool follows RFC 9535 and rejects them with the position of the problem.
  • AWS Step Functions accepts JsonPath in fields such as InputPath, but a reference path such as ResultPath must point to a single node and cannot use filters, wildcards or slices, which this tool accepts.

To reshape JSON rather than only select from it, use the jq Playground; to check the document first, use the JSON Formatter.

FAQ

What is JSONPath?

JSONPath is a query language for JSON, analogous to XPath for XML. It uses a path expression to select nodes from a JSON document. RFC 9535 (2024) standardizes it. Variants of it appear in kubectl output templates, AWS Step Functions and many API testing tools.

What does $ mean in a JSONPath expression?

$ refers to the root element of the JSON document. Every valid JSONPath expression must start with $. On its own, $ selects the entire document. You chain selectors after it, such as $.store.book[0].title.

How do I select all items in an array?

Use the wildcard selector [*] after the array's key. For example, $.store.book[*] returns all book objects in the array. You can further drill into each item: $.store.book[*].author returns every author value.

How do filter expressions work?

A filter is written [?expression], and @ is the element being tested. Under RFC 9535 the parentheses are optional, so $.store.book[?@.price < 10] and $.store.book[?(@.price < 10)] are the same. You can use ==, !=, <, <=, >, >=, combine conditions with &&, || and !, test nested paths such as @.author.name, compare with other parts of the document through $, and call length(), count(), match(), search() and value().

What is recursive descent (..) ?

The .. operator recursively searches all descendants of the current node. For example, $..author finds every author field anywhere in the JSON tree, regardless of nesting depth.

Why do I see "Unsupported syntax"?

The expression uses syntax that RFC 9535 does not define, so the tool stops and shows the character position instead of returning an empty result. Common cases are script expressions such as [(@.length-1)] (use [-1]), the =~ operator (use match() or search()), and in / nin. An empty result with "No matches found" means the expression is valid but nothing in the JSON matches it.