JSON Path Tester

Runs in browser JSON & Data

Test JSONPath queries interactively. Supports dot and bracket notation, wildcards, recursive descent (..), array slices, unions and filter expressions such as [?(@.price < 10)].

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

What is JSONPath?

JSONPath is a query language for selecting values inside a JSON document, in the way XPath selects nodes in XML: $.store.book[*].author picks every author. It was standardised in 2024 by RFC 9535, which fixed the syntax and the meaning of filters that earlier implementations disagreed on.

How to use JSON Path Tester

  1. Paste the JSON document.
  2. Type a JSONPath expression such as $.store.book[?(@.price < 10)].title.
  3. Inspect the matches; copy the values or the paths.

JSON Path Tester features

  • Original (pre-RFC 9535) JSONPath syntax: dot/bracket access, wildcards, recursive descent, slices, unions and parenthesised filters
  • Filter expressions with comparisons, regex (=~), in / nin, arithmetic and boolean logic
  • Safe evaluation — no eval(), expressions are parsed into an AST
  • Results as a table (path, type, value), a JSON array of values and a list of match paths
  • Evaluates live as you edit the expression or the document
  • Friendly syntax errors that point at the problem

JSON Path Tester example

Find cheap books

Input:

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

Output:

$.store.book[0].title   "Sayings of the Century"
$.store.book[2].title   "Moby Dick"
Each segment works on what the previous one returned; inside the filter @ is each book in turn, so only 2 of the 4 books reach .title.
  1. 1$The root: the whole document, 1 node
  2. 2.storeChild store of that node: 1 object$.store
  3. 3.bookChild book: 1 array of 4 books$.store.book
  4. 4[?(@.price < 10)]Filter, in parentheses: [?(…)]Tests each book, with @ as the book being tested. Kept: book[0] 8.95, book[2] 8.99$.store.book[0] $.store.book[2]

    Branch: Dropped: book[1] 12.99, book[3] 22.99

  5. 5.titleChild title of each kept book: 2 strings$.store.book[0].title $.store.book[2].title

Then:2 matches: "Sayings of the Century" and "Moby Dick"

The expression of the example above, run on the tool’s sample document (Load example). Under steps 2–5: the paths each step returns.

Frequently asked questions about JSON Path Tester

Which JSONPath features are supported?

The tester follows the original JSONPath syntax used by most libraries before RFC 9535 (2024): dot and bracket notation, wildcards (*), recursive descent (..), array indexes including negatives, slices [start:end:step], unions [0,2] and ["a","b"], filters [?(…)] and the (@.length-1) script form. RFC 9535 forms that differ are not accepted: filters need parentheses ([?(@.price < 10)], not [?@.price < 10]) and the functions length(), count(), match(), search() and value() are not available.

What can I write inside a filter?

Comparisons (==, !=, <, <=, >, >=), regular expressions (@.name =~ /^a/i), membership (@.tag in ["a","b"]), existence (@.isbn), arithmetic and logical operators (&&, ||, !). References to the root ($) are allowed too. The =~, in, nin and contains operators are extensions of older libraries, not RFC 9535 syntax.

Is it safe to evaluate filters?

Yes. Expressions are parsed into a small AST and evaluated by the tool itself — no eval() or Function() is ever used, so nothing can execute arbitrary code.

What path is shown for each match?

The unique location of the match in dot/bracket notation, for example $.store.book[2].title. Use it to reference the value precisely in tests or documentation. It is not an RFC 9535 "Normalized Path", which uses only brackets and single-quoted names: $['store']['book'][2]['title'].

Technical notes

The path is tokenised into segments (child, wildcard, index, slice, union, filter, script). Filters are compiled to a small expression tree supporting ==, !=, <, <=, >, >=, =~, in, nin, contains, &&, ||, !, unary minus and + − * / %. Comparisons between mismatched types evaluate to false, mirroring the behaviour of popular JSONPath libraries.

References