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.booksis 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.$..pricefinds 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 tools
XPath Tester
Test XPath expressions against XML — evaluate nodes, strings, numbers, and booleans with presets.
JSON Minifier
Minify JSON by removing all whitespace and comments. Shows original vs minified byte sizes and savings percentage. No upload needed.
JSON to TypeScript
Generate TypeScript interfaces from any JSON object — handles nested objects, arrays, nullable types, and optional fields.
JSON Diff Checker
Compare two JSON objects and see exactly what was added, removed, or changed — a structural diff, not a text diff.
JSON to PHP Array
Convert JSON into a ready-to-paste PHP array using modern short-array syntax.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to XML
Convert JSON structures into nested XML markup.
XML to JSON
Convert XML markup into a structured JSON object.