Skip to content

JSONPath Tester

Runs a JSONPath expression against a document and highlights the matched nodes as you type.

Runs a JSONPath query against a document and shows every node it selected, with the path to each. It implements RFC 9535 — the 2024 standard — rather than one of the twenty years of mutually incompatible implementations that came before it, which matters as soon as your query has a filter in it.

🔒 Runs entirely in your browserjsonjsonpathquerytest

Query

From the root: anywhere below, the member “book”; then the children that pass the filter; then the member “title”.

Document

Matches

Results appear here as you type.

This follows RFC 9535, the 2024 standard, not the twenty years of incompatible implementations before it. The differences that bite: a result is a nodelist and keeps duplicates, .. visits a node before its children, a missing member equals only another missing member, and comparing against a query that could match several nodes is a syntax error rather than a guess. Patterns inside match() and search() are handed to your browser’s own regular-expression engine, which accepts more than the I-Regexp dialect the RFC specifies.

How to use it

  1. Paste the document

    Anything that parses as JSON. The query runs in a worker, so a large document keeps the page responsive while you type.

  2. Write the query, or start from an example

    The buttons under the box cover the shapes people need: a wildcard, a descendant search, a slice, a filter, a regular expression and a function. A plain-English description of what your query means appears above them.

  3. Read the matches with their paths

    Each result carries the normalised path that reached it, so you can see whether a match came from where you expected. The stat line says whether the query is singular — able to select at most one node — which is what a JSON Pointer would be.

Common questions

My query works in another tool but not here.

Probably an RFC 9535 difference. The standard removed things older implementations allowed: script expressions in `()`, `$..[?(@.x)]` with the older parenthesised filter syntax, and comparing against a query that could match several nodes — that last one is now a syntax error rather than a guess.

Why does the same value appear twice?

Because the result is a nodelist, not a set. `$..price` reaching the same node down two branches lists it twice, by design — deduplicating would lose the information about where each match came from.

Are the regular expressions in `match()` standard?

Not exactly. The RFC specifies I-Regexp, a small dialect; the patterns here are handed to your browser’s own engine, which accepts more. A pattern that works here may be rejected by a strict implementation — worth knowing before you put one in production.

Can it modify the document?

No — JSONPath selects, it does not write. For editing, the paths shown here are RFC 6901 pointers and can go straight into a JSON Patch, which the JSON diff tool on this site produces.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.