DevLab
{}
JSONintermediate

JSONPath Tester

test JSONPath expressions against JSON data in real time

By Bikram NathLast updated

JSONPath Tester evaluates expressions like `$.store.book[?(@.price < 10)].title` against live JSON and shows matching nodes instantly. It's the fastest way to verify a filter predicate before wiring it into a data pipeline or API client. Unlike jq, it uses the browser's JavaScript runtime to evaluate standard JSONPath syntax, so what you test here matches what most JS libraries return.

Try it now — free, instant, no signup

What is JSONPath Tester?

JSONPath Tester parses a JSON document and evaluates a JSONPath expression against it, returning the matched nodes in real time. Paste in an API response, type `$.users[*].email`, and you immediately see every email address extracted from the array rather than counting brackets manually or writing a throwaway script.

Developers reach for this when they are working with a JSONPath-aware library like Jayway (Java), jsonpath-ng (Python), or the `jsonpath` npm package, and need to validate expressions before embedding them in code. jq is the command-line alternative for the same job, but jq uses its own filter syntax that differs from JSONPath, so a jq filter you test locally may not translate directly to a library expecting RFC 9535-style JSONPath.

One gotcha worth knowing: the recursive descent operator `..` behaves differently across JSONPath implementations. The expression `$..price` will match all `price` keys at every depth in most libraries, but some older implementations skip keys inside arrays. If your library is Goessner's original 2007 spec rather than the 2024 RFC 9535 standard, results for filter expressions using `?(...)` syntax may diverge from what this tester shows.

When to use JSONPath Tester

Verify a filter expression like `$[?(@.status == 'active')]` returns the right subset before embedding it in an ETL job.
Debug why a deeply nested path like `$.data.results[0].meta.tags[2]` returns undefined in production by testing it against a real response payload.
Prototype array slice notation such as `$[1:4]` to confirm which elements a JSONPath slice covers before writing unit tests.

Frequently Asked Questions

What is the difference between JSONPath and jq syntax?
JSONPath and jq both query JSON, but they are different languages. JSONPath uses dot-notation and bracket syntax (`$.store.book[0].title`) and is what libraries like Jayway, jsonpath-ng, and most API gateways expect. jq has its own filter grammar (`.store.book[0].title` with no leading `$`) that is richer and supports transforms, not just selection. If you copy a jq filter and paste it into a JSONPath-aware library, it will fail or silently return wrong results. This tester evaluates JSONPath, not jq.
Why does `$..name` return duplicate values?
The recursive descent operator `..` walks every node in the document tree, including intermediate objects. If your JSON has a `name` key at both the top level and inside a nested array of children, `$..name` returns all of them. That is correct behavior. If you only want names at a specific depth, use an explicit path like `$.employees[*].name` instead of recursive descent. Duplicates typically appear when the same key exists in a parent object and inside objects within one of its array properties.
Does JSONPath support regex matching inside filter expressions?
The 2024 RFC 9535 standard defines a `match()` function for regex inside filter expressions, for example `$[?match(@.email, '.*@example\.com')]`. However, support varies by library. Goessner's original 2007 spec has no built-in regex function, so many older implementations simply ignore unknown functions or throw an error. If your target library is Jayway or jsonpath-plus, regex via `=~` or `match()` is usually supported. Check your library's docs against what this tester returns if results diverge.
How does JSONPath array slicing work, and is it zero-indexed?
Yes, JSONPath array indices are zero-based. The slice `$[1:4]` returns elements at indices 1, 2, and 3, matching Python slice semantics. A negative index like `$[-1:]` returns the last element. The step parameter `$[0:6:2]` returns every other element from index 0 to 5. One common confusion: `$[2]` selects the third item (index 2), not the second. If your expression returns one item earlier or later than expected, check whether you are confusing 0-based vs 1-based counting.
Can JSONPath expressions modify or transform data, or only read it?
JSONPath is a read-only query language. It selects and extracts nodes; it cannot rename keys, change values, delete fields, or reshape output the way jq can. If you need to extract and then transform, the typical workflow is: use JSONPath to select the nodes, then apply your own mapping logic in code. For transform-heavy use cases, jq's `with_entries`, `map`, and `select` combinators are a better fit than JSONPath, even though jq requires a local install or a separate online runner.

Related Tools