JSONPath Tester — Test JSON Queries Online

Test JSONPath expressions against your JSON document. See every match with its path and value, including wildcards and recursive descent.

Input

Supported syntax

About JSONPath Tester

JSONPath is a query language for extracting data from JSON documents, loosely inspired by XPath for XML. Expressions like $.store.book[*].title let you pull specific values out of deeply nested structures without writing loops — useful for inspecting API responses, configuration files, or any large JSON payload in a shell script or automation.

Use this tester to validate and debug expressions before embedding them in code or tooling. This implementation supports the core syntax (child access, wildcards, indices, slices, and recursive descent) but not filter predicates like [?(@.price > 10)] — if you need filtering, run the expression in a full JSONPath library such as jsonpath-plus in your project.

How expressions are parsed

The expression is tokenised by a hand-written scanner into four token types — key, wildcard, index, slice — plus a recursive marker for `..`. An expression must begin with `$`, and each `.name` segment must match a JavaScript identifier pattern, so a key containing a hyphen has to be written in bracket form. Anything the scanner does not recognise raises a specific error naming the offending character or bracket content.

Tokens are applied left to right against a set of current nodes, producing a new set per token, which is what makes multi-segment paths like `$.store.book[*].title` work. Index and slice bounds are clamped to the actual array length rather than erroring, so an out-of-range index yields an empty result instead of a diagnostic.

Recursive descent and what it returns

Recursive descent is implemented differently from the reference behaviour. Rather than descending one level and retrying, the matcher walks the entire document collecting every node, then matches the following token against the children of all of them. The result is correct for the common `$..price` case, but each match path is reconstructed by searching the document for the parent object by identity and reporting the first hit — so identical sibling structures can display paths that do not correspond to the match you expected.

Paths for wildcard results under recursion are rendered with a literal `.*` suffix rather than the concrete key, which is a display limitation rather than a matching one. Matches are listed with an index, the path, and the value, with strings truncated at 70 characters and serialised objects at 120 — enough to recognise a value, not enough to read a large one.

Unsupported syntax

Filter expressions are the notable gap. Bracket contents that are not an index, a slice, a quoted key, or a wildcard raise `Unsupported token inside []`, so `$[?(@.price > 10)]` — the example most often reached for — will not run. Slices accept only `start:end` with non-negative integers, so negative indices and step values such as `[::2]` are rejected, unlike most JSONPath implementations.

Script expressions, the union and length operators, and parent or sibling selectors are absent for the same reason — the scanner has four token types and no room for an expression evaluator. When you need those, validate the expression against a full JSONPath library inside your own project; this tester covers the core syntax that handles most extraction work, and the error messages will tell you quickly when you have reached past it.

Frequently Asked Questions

How do I test a JSONPath expression?
Paste your JSON document in the top panel and enter a JSONPath expression (like $.store.book[*].author or $..price) in the query field. Matches are highlighted in the JSON and listed below the query input.
What JSONPath syntax is supported?
The tool supports the standard JSONPath syntax: dot notation ($.name), bracket notation ($['name']), wildcards ($..*), filters ($[?(@.price>10)]), and recursive descent ($..). It follows the JSONPath specification.
Is my data sent to a server?
No. Every tool on jsonversal runs entirely in your browser using the Web Crypto API, File API, and Clipboard API. Nothing is ever uploaded — not even the JSON you paste in.
Do I need an account or API key?
No signup, no email, no API key. All tools are free to use with no signup required.
Can I use these tools offline?
Yes. Once the page loads, all tools work offline. There are no external API calls or CDN dependencies at runtime.
🔒
Your data never leaves your device

All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.

esc
↑↓ navigate ↵ open esc close