JSONPath Tester

Write an expression, see what it matches in your data, as you type.

About this tool

Write a JSONPath expression and see what it matches in your data, as you type. Every match lists its path — $.users[0].name — next to its value, so an expression explains itself against the real document.

The supported grammar: $ root; .name and the quoted bracket form for members (needed for keys with dots); [0] indexes and negative indexes; [*] and .* wildcards; [start:end:step] slices; ..name recursive descent; and filters — [?(@.key)] for existence, [?(@.key > 2)] for comparisons.

Not implemented, deliberately: in-place expressions, parent references, and functions like length(). They break the everything-is-static promise — an expression here reads the document; it never rewrites it.

How to use it

  1. Paste your JSON into the document pane.
  2. Type an expression in the box above the matches — it evaluates live.
  3. Read the matches with their paths. Zero matches is a valid answer, not an error.

Worked example

The sample expression keeps the books priced under 15 and takes their titles — Reference and Handbook, with their paths. Change the number and the list changes with it.

One expression, live answer

Frequently asked questions

What is JSONPath, exactly?
A path language for JSON, standardised as RFC 9535: an expression names a set of nodes in a document the way XPath names nodes in XML. $.store.book[0].title is one — the title of the first book.
How do filters work?
[?(@.age > 30)] keeps array items or object members whose age exceeds 30. @ is the item being tested; the path after it is read on that item; the comparison supports numbers and strings. An existence filter — [?(@.email)] — keeps items that have the field at all.
Why does my expression with length() not work?
Functions like length(), min() and max() are extensions some libraries add, not part of the core RFC grammar. This tester implements the core: a slice like [0:5] answers "first five" without any function.
How do I match keys containing dots?
Use the quoted bracket form: $['a.b'] matches the key a.b. The dot in .a.b would otherwise be read as two levels.
Is my data uploaded anywhere?
No. The expression runs in your browser against the document in the pane; nothing leaves the tab.