JSONPath Tester
Test JSONPath expressions against JSON data. Supports dot notation, wildcards, slices, and recursive descent.
✓
✓ Valid path! Found 3 matches.
Output updated — 37 characters
JSONPath syntax reference
JSONPath (like XPath for JSON) uses $ as the root, .key for property access, [n] for array index, [*] for all items, [start:end] for slices, and ..key for recursive descent. This tester implements the common subset used in 95% of real-world expressions. For JSON schema validation, try JSON Schema Generator. To format your JSON, use JSON Formatter.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Checking a JSONPath expression against real data before using it.
- Working out why an expression matches nothing.
- Testing a recursive descent against a deeply nested document.
- Comparing a filter expression's result with what you expected.
- Extracting a value from a large payload without writing code.
Frequently Asked Questions
- What does $ mean at the start of an expression?
- The root of the document. Every JSONPath expression starts there, so `$.store.books` is read as "from the root, the store key, then books". It is the counterpart to XPath's leading slash, and the tool accepts an expression without it as a convenience.
- What is the recursive descent operator?
- `..`, which searches every level below the current node rather than one. `$..price` finds every price in the document regardless of how deeply it is nested — useful for exploring an unfamiliar payload, and expensive on a large one because it visits every node.
- How do I select array elements?
- By index in brackets — `$.store.books[0]` — with `[*]` for all of them and slice syntax like `[0:2]` for a range. Bracket notation is also how you reach a key containing a dot or a space, which dot notation cannot express.
- Why does the result come back as a list?
- Because a JSONPath expression can match many nodes. Even `$.store.name`, which matches exactly one, returns a single-element list — the shape is uniform so that a consumer never has to branch on whether the expression happened to be specific.
- Is JSONPath standardised?
- It was not for two decades — implementations diverged on filters, slices and the exact result ordering — and RFC 9535 finally standardised it in 2024. Expressions written against an older library may still behave differently, so test the ones that matter against the runtime you will actually use.
Common errors and gotchas
- Assuming one JSONPath dialect, since filter and slice support varies substantially between implementations.
- Expecting a single value where the expression returns a list, which most do.
- Using a filter expression a library does not support, which silently returns nothing.
- Confusing JSONPath with JSON Pointer, which are different syntaxes for different jobs.
- Testing against a sample whose shape differs from production, so the expression breaks later.
Related Developer Utilities tools
RegExp Tester
Test regular expressions and inspect matches locally.
Regex Visualizer
Visual regex pattern diagram with live match highlighting and capture group annotations.
Subnet Calculator
Compute CIDR subnets, usable hosts, and network ranges.
Cron Parser
Translate cron syntax into plain English.
URL Parser
Break a URL into protocol, host, path, and query parts.
HTML Previewer
Paste HTML and see it rendered live in a safe, sandboxed preview.
HTTP Status Code Reference
Search and look up every HTTP status code and its meaning.
MIME Type Lookup
Find the MIME type for a file extension, or the extensions for a MIME type.