About JSONPath Tester
Test JSONPath queries against your JSON live. Wildcards, array slicing, recursive descent, filter expressions — all supported. Each match shows its path and value, and the matched substrings highlight in the source for visual confirmation. Useful when extracting data from large API responses without writing code.
What JSONPath gives you
A way to extract values from a JSON document by path, without writing code. The syntax is dense but learnable in 20 minutes:
| Expression | Meaning |
|---|---|
$ | The root |
.foo or ['foo'] | Property foo |
[0], [-1] | Array index (negative counts from end) |
[0:5] | Array slice |
* | All elements |
..foo | Recursive descent — every foo at any depth |
[?(@.age > 18)] | Filter — items where the condition holds |
[1, 3, 5] | Specific indices |
How to use the tester
- Paste JSON in the upper pane.
- Type a JSONPath query in the input.
- Watch matches appear in the result panel; each result shows the resolved path and value.
- Click a result to highlight the source location.
Common workflows
Extract from a large API response. A 5 MB response with the data you need three levels deep. $.data.items[?(@.status == 'active')].id pulls just the IDs.
Verify a webhook payload contains expected fields. $.event.user.email returns the email if present, empty otherwise. Quick sanity check before writing the parser.
Map fields for an ETL. Find the path to each desired field, write them down, transcribe to your transformation code.
Build assertions for tests. A test that says expect($.user.id).toBe('123') is more readable than walking the object manually. Some test runners accept JSONPath directly.
Why a tester beats a one-shot script
A throwaway script forces a context switch. The tester gives you immediate feedback — type, see results, iterate. Once the path is right, copy it into your real code. The same skill scales from one-off API debugging to production query writing.
Frequently asked questions
What is JSONPath?
$ is the root; dots traverse properties; brackets index arrays. Wildcards (*), recursive descent (..), and filters ([?(...)]) build expressive queries.How does it differ from JMESPath?
Can I use filter expressions?
$.users[?(@.age > 18)] selects all users older than 18. @ is the current element; standard comparisons (==, !=, <, >, <=, >=) and logical (&&, ||, !) work.What does <code>..</code> do?
$..price finds every property named price at any depth. Useful when the structure is nested and you do not want to write the full path.Can I extract multiple paths at once?
$..[?(@.id == 1 || @.id == 2)] with logical operators. For unrelated selections, run two queries and merge results in code.Is the query running in my browser?
Related tools
Last updated: 2025-01-15