🔍 JSONPath Tester

Live JSONPath expression evaluation against JSON data.

Last updated: June 9, 2026 · By Λ

By Λ · Updated June 9, 2026 · ~3 min read

What JSONPath is for

JSONPath is to JSON what XPath is to XML: a query language for extracting subsets of data. You give it a path expression and a document; it gives you back every value that matches. If you have ever written JSON.parse(text).store.book.filter(b => b.price < 10).map(b => b.title) in JavaScript, JSONPath is the same idea but as a single string you can pass around between languages.

Syntax basics

When to reach for JSONPath

JSONPath shines when you need to extract data from a JSON response without writing code that depends on the language. AWS CLI, Kubernetes kubectl, jq (with caveats), and many API clients accept JSONPath expressions as flags. Once you internalize the syntax, you can write a one-line shell command that does what would take a script in any other tool.

JSONPath vs jq vs JMESPath

jq is more powerful but uses its own DSL. Better for pipelines and transformations.

JMESPath is AWS's answer to JSONPath. Stricter syntax, no recursive descent. Used in AWS CLI --query flags.

JSONPath is the most widely supported across languages and tools. The 2024 RFC 9535 finally standardized it, ending years of dialect drift.

How this tester works

The evaluator behind this page is a small hand-rolled parser, not a wrapped library. It splits your expression into tokens (names, wildcards, indexes, slices, unions, filters, recursive descent) and walks the parsed document, collecting every node the chain reaches. Filters use [?(@.field op value)] with ==, !=, <, >, <=, or >=, compared against a number, quoted string, true, false, or null. Because the script ships embedded in the page, the document you paste gets parsed inside your own tab and no upload step exists anywhere in the flow.

Worked examples

The preloaded sample is the classic bookstore document: four books and a bicycle. Run $..book[?(@.price<10)] and the right panel prints a two-element array holding the Nigel Rees entry (8.95) and the Moby Dick entry (8.99). Next, $.store.book[1:3].title keeps slice indexes 1 and 2 and outputs ["Sword of Honour", "Moby Dick"].

Limitations to know about

A filter accepts exactly one comparison on a direct field, so && chains, nested paths like @.a.b, regex matching, and RFC 9535 functions such as length() are out of scope. Comparisons use JavaScript's loose rules, so the number 10 equals the string "10". Union brackets only take numeric positions, and recursive descent emits shallower nodes before deeper ones, which can reorder results relative to other libraries.

Frequently asked questions

Why does my filter return zero matches?

The path in front of the filter must land on the container whose children get tested. On the sample, $.store[?(@.price>15)] checks the direct children of store and matches only the bicycle at 19.95, while $..book[?(@.price>15)] reaches the array and matches the Tolkien volume.

Can I query keys that contain spaces or dashes?

Yes, with quoted brackets. Dot access only recognizes word characters, so a key named release-date is reachable as $['release-date'] but not via the dot form.

Which JSONPath dialect does this follow?

A practical Goessner-style subset covering the operators most tools agree on. Confirm tricky expressions against the library you actually ship, since corner cases still vary.

Related

For full JSON validation, see the JSON formatter. For converting JSON to TypeScript types, see json-to-typescript. For JSON Schema validation, see the JSON schema tool.