JSONPath Tester

Run a JSONPath expression — wildcards, recursive descent, slices, filters like $.store.book[?(@.price<10)] — against JSON with the jsonpath-plus engine.

You can also drop a .json or .txt file onto the box.

JSONPath syntax, operator by operator
OperatorMeaningExample — click to try it
$The root of the document
@The element a filter is looking at
.name ['name']A child by name; brackets for a name with spaces or dots
..Recursive descent: that name at any depth
*Wildcard: every member or element
[n]An array element by index, counting from 0
[a,b]Union: several indexes or names at once
[start:end:step]Slice: a range of elements, end not included; a negative number counts from the end
[?( )]Filter: the elements for which the expression is true
( )Script: an index worked out from the element

Enter a JSONPath expression to see matching values.

What a JSONPath expression actually selects

JSONPath Tester lets you paste a JSON document, type a JSONPath expression, and instantly see every value it selects, with a running count. Under the values, “Where each match came from” gives each match the exact path that selects it — $.store.book[0].price — so two equal values are told apart, and Copy paths takes them all. It works the other way round too: click a value in the JSON and the page names the expression that selects it, with a Use this path button. Confirm a query before wiring it into an API pipeline, a config lookup, or a test assertion.

How it works

Your JSON is parsed with the browser’s native parser and queried with the jsonpath-plus engine running entirely on your device — nothing is uploaded, so even confidential payloads stay local.

Supported syntax

Use dot and bracket notation, wildcards (*), recursive descent (..), array slices, and filter expressions such as $.store.book[?(@.price<10)]. Filters run in a CSP-safe evaluator, so no code from your query is ever executed unsafely. The “JSONPath syntax, operator by operator” table under the expression box explains each operator with an example, written for the Sample document, that a click puts in the box — with the Sample document too when the JSON box is empty, so each is a worked example from a fresh page.

Reading a large document

Beautify and Minify rewrite the JSON box by moving only the whitespace between tokens, so long numbers, escapes and repeated keys come out exactly as they went in. The document as a tree opens the root and leaves everything under it closed until you open it, an open array drawing its first members with a line saying how many more there are, and clicking a name puts its path in the expression box. Copy link puts the expression in the link it copies; the JSON is not in the link. The document is parsed once each time it changes, so typing an expression never reads it again, and a very large document is parsed once you pause typing in it rather than on every keystroke. A .json or .txt file can be dropped onto the box as well as opened.

Frequently asked questions

What is JSONPath?

JSONPath is a query language for JSON, analogous to XPath for XML. An expression like $.store.book[*].author walks the document and returns every matching value.

Why do I get an "Invalid JSON" error?

The document must be valid JSON — double-quoted keys and strings, with no trailing commas or comments. The error names the line and column of the problem, so you can fix it there, or run the text through the JSON Formatter or JSON Repair first if you are unsure.

How do I find the path to one particular value?

Click it in the JSON box, or move the cursor there with the keys: Path at the cursor: names the expression that selects it, such as $.store.bicycle.color, and Use this path puts it in the expression box. Going the other way, Where each match came from lists the path of every match your expression found — so two records with the same price are told apart — and Copy paths copies them all. A key holding a character JSONPath cannot quote gets no path rather than a wrong one.

Can I fold a large document, tidy it, or share my query?

Yes. The document as a tree shows the JSON with the root open and everything under it closed; each object or array opens on its own, a large one draws its first members with a line saying how many more there are, and clicking a name puts its path in the expression box. Beautify and Minify rewrite the JSON box moving only whitespace, so long numbers, escapes and repeated keys come out exactly as they went in; they wait while the box is not valid JSON. Copy link puts the expression in the link it copies — the JSON is not in the link.

Does it keep up with a multi-megabyte document, and can I drop the file in?

Yes. The document is parsed once each time it changes and every expression runs over that one parse, so typing a query never reads the document again. A very large document is parsed when you pause typing in it rather than on every keystroke; a small one answers at once. Drop a .json or .txt file onto the JSON box and it is read like one from Open file… — the same size limit, its text encoding checked, its name kept for the download — and any other kind of file is refused with a message.