JSONPath & jq Evaluator
Finding one field buried deep in a long JSON document is often harder than it should be. This tool puts the two query languages developers reach for on the same page: JSONPath for selecting, pulling out exactly the nodes you want with a path like $.store.book[*].author, and jq for transforming, filtering, mapping, and aggregating in near-programmatic pipelines. Paste JSON on the left, type an expression at the prompt, and the result refreshes on the right the instant you type, with a live count of how many values it matched. JSONPath is the default and loads nothing, so it is ready immediately; jq only fetches its wasm engine the first time you switch to it. Everything runs locally in your browser, so nothing you paste ever leaves the tab.
- Two engines on one page: JSONPath selects nodes precisely while jq filters, maps, and aggregates, covering everything from picking a single field to reshaping the whole document
- Evaluates as you type, refreshing the instant you edit the JSON or the expression, with a clear match count that tells a real zero-match result apart from a broken query
- Reports JSON parse errors and query syntax errors separately, each pinned to the input or the expression, instead of quietly emitting empty or partial output
- JSONPath is instant with no download, and the jq engine is fetched only when you switch to it and then cached, all in your browser with nothing sent off your device
JSONPath and jq syntax cheatsheet
New to either syntax? No problem. The two tables below list the symbols and functions you will use most, each with what it does and an example you can adapt to your own fields. Change the field names to match your data and you are running queries in minutes.
Common JSONPath syntax
$ $ @ @.price .name $.store .. $..author * $.store.* [n] $..book[0] [a:b] $..book[0:2] [?(expr)] $..book[?(@.price < 10)] ['a','b'] $..book[0]['title','price'] Common jq syntax
. . .foo .store .a.b .store.bicycle.color .[] .store.book[] | .store.book[] | .title select(cond) .store.book[] | select(.price < 10) map(f) .store.book | map(.price) add / length [.store.book[].price] | add sort_by(f) .store.book | sort_by(.price) Overview
A query tool is only worth using if it lets you see the result clearly, and the error just as clearly. This one is built around both: instant output, a match count you can trust, and errors that keep an input problem separate from an expression problem.
- 01
Two engines, each to its strength
JSONPath is best at selecting values by path, with terse syntax you pick up fast. jq is a full JSON processor that filters, maps, aggregates, and reshapes structure. Switch between them on one page, so picking a field and running a complex transform never means changing tools.
- 02
Evaluates as you type
There is no run button to press. Whether you edit the JSON or the expression, the result refreshes after a short debounce, so you write and read at the same time and explore unfamiliar data far faster.
- 03
A match count you can trust
Every query shows how many values it matched, so you see at a glance whether the result is one, many, or none. An empty result says No matches plainly instead of leaving a blank you have to second-guess.
- 04
Layered error reporting
When the JSON itself will not parse, the error is pinned to the input panel; when the expression is wrong, it is pinned to the query bar with the engine’s own message. The two are shown apart so you know instantly which side to fix.
- 05
Pretty and compact on demand
Read the result indented across multiple lines to inspect it layer by layer, or collapse it onto single lines to paste straight into code or a command. One toggle flips between the two.
- 06
Reuse and export in one click
A canonical bookstore document and a set of example expressions, from simple to advanced, are one click away. Copy the result or download it as a .json file to carry into the next step.
How to use
Go from an unfamiliar JSON document to just the part you need in a few steps, with the result and the match count in front of you the whole time.
- 01
Paste your JSON into the input panel on the left, or click Sample to load a ready-made bookstore document to practise on.
- 02
Choose the query language at the bottom: JSONPath to select values, or jq when you need to filter, compute, or reshape.
- 03
Type an expression in the query bar, or click one of the example expressions below to apply it, and the result refreshes on the right with the match count.
- 04
Use Pretty/Compact to adjust the shape, then copy the result or download it as a .json file to drop into your code, script, or notes.
Details
The details that make the result trustworthy and quick to work with.
- JSONPath is powered by the mature jsonpath-plus, with full support for recursive descent, wildcards, filter expressions, and array slices.
- jq is the official jq compiled to WebAssembly, so the syntax matches the command line exactly: whatever you write in a terminal runs here unchanged.
- Queries run as you type, with no run button and no lag between changing an expression and seeing the new result.
- JSON parse errors and query syntax errors are shown in place with their original messages, rather than silently producing empty or broken output.
- Everything runs locally in your browser. The JSON you paste, including sensitive API responses, is never uploaded or logged, and is gone when you close the tab.
Use cases
Where a single query saves a lot of hunting around.
-
Debugging API responses
An endpoint returns a wall of nested JSON and you want to confirm where a field lives and whether its value is right. One path pulls it out, without folding and unfolding levels in an editor.
-
Computing over data
When you need the total of a batch of prices, a deduplicated list of authors, or the length of an array, a single jq pipeline computes it far faster than writing a throwaway script.
-
Validating and debugging expressions
Before a JSONPath or jq expression goes into code, a CI script, or a log pipeline, try it here against real data to confirm it matches exactly the nodes you intend.
-
Understanding an unfamiliar shape
Given undocumented JSON, recurse with $.. or sweep a level with a wildcard, watching the result as you write, to quickly map out its levels and fields.
See also
Just want to tidy or validate the JSON itself? Use theJSON Formatter , and to compare two JSON documents, try theJSON Diff .
JSONPath and jq, and what each is for
Both work on JSON, but they start from different places. JSONPath is a query: it only pulls out the nodes you ask for. jq is a processor: it can keep working on them once they are out. Understand that line and you always know which one to reach for.
-
JSONPath: select by path
Modelled on XPath, it describes the node you want with a single path. $ is the root, . steps down a level, and what comes out is always a value already present in the document, never rewritten. To pull data out of a document, it is the most direct route.
-
The core JSONPath symbols
$ is the root node, .. recurses to any depth, * is a wildcard matching everything at a level, [?(@.price < 10)] is a filter expression, and slices like [-1:] take by position. A few symbols combined cover the vast majority of selection needs.
-
jq: JSON as a stream to process
jq is a small but complete language. It treats JSON as values flowing through a pipe, |, where each filter transforms the output of the last. It can select, filter, and reshape, and it can compute. When you want to do something with the data after selecting it, jq is the answer.
-
The jq you will use most
map transforms each item of an array, select keeps items by a condition, add sums, unique deduplicates, length counts, and max_by finds an extreme. Strung together with pipes, they express totals, restructuring, and summaries that JSONPath cannot.
-
One selects, the other computes
Put simply: if you only want to find a value, JSONPath is shorter and more direct; if you want to filter, compute, or reshape after finding it, hand it to jq. That is exactly why this tool sits the two side by side.
-
Why the result is a set of values
Both engines naturally produce a set of values: every node JSONPath matches, and every result jq streams out. So the tool tells you how many there are and lists them together, in the pretty or compact form you choose.
Best practices
Habits that keep queries both accurate and efficient.
- Decide first whether you are selecting or transforming: use JSONPath to pull out existing nodes, and reach for jq only when you need to filter, compute, or reshape. Do not make a simple task complex with the wrong tool.
- Lean on recursive descent. Both JSONPath’s .. and jq’s .. search across levels, which is more robust than hard-coding a path level by level when the structure is uncertain.
- Use the match count to verify the expression. After writing it, glance at how many values it matched; a number that misses your expectation usually means the path or condition is slightly off.
- Collapse the result to compact before pasting it into code or a command line, and keep the indented view for when you need to read and verify layer by layer.
- Validate here before the expression lands in code or a script. The tool uses the standard jsonpath-plus and the official jq, so behaviour matches production.
Limitations
What this tool does, and what it leaves to other steps.
- It queries a single JSON document. It does not merge multiple files or fetch external data referenced by a URL.
- It focuses on querying and transforming, not full JSON editing; for large structural rewrites or formatting, use the dedicated formatter.
- The JSONPath implementation follows jsonpath-plus syntax, and a few extended forms can differ between implementations; the tool’s result is authoritative here.
- JSON that cannot be parsed is reported rather than repaired, so badly broken input will not produce a half-right result.
FAQ
Common questions about JSONPath, jq, and how to use this tool.
What is the difference between JSONPath and jq, and which should I use?
In a sentence: JSONPath selects, jq processes. If you only want to pull a node out of a JSON document, JSONPath’s path syntax is the shortest, most direct route, for example $.store.book[*].author. If you also need to filter, sum, deduplicate, or reshape after pulling it out, you need jq, which is a complete JSON processing language. The tool sits both on one page so you can switch as the task demands.
Can I use my command-line jq expressions directly?
Yes. The jq here is the official jq compiled to WebAssembly, so the syntax is identical to the command line: pipes, built-in functions, select, map, reduce, and the rest all work. Whatever you write in a terminal runs here unchanged, with no edits needed.
Why is there a loading step when I switch to jq?
JSONPath is small and synchronous, so it is the default engine and is ready the moment the page opens. jq is a roughly 1MB WebAssembly engine, fetched only the first time you switch to jq and then cached for the rest of your visit. That way visitors who only use JSONPath never pay the cost of loading jq.
What does the "N matches" count mean?
It is how many values the current expression matched or produced. JSONPath gathers every node that fits the path into a set, and jq streams out a series of result values; the number is simply their count. When it is zero it shows No matches, which helps you tell a genuine absence of data from a mistake in the expression.
Is my JSON uploaded anywhere?
No. All parsing and querying happen in your browser. The JSON you paste and the result are never transmitted or stored, and disappear the moment you close the tab, so even sensitive API responses are safe to debug here.
Why does the previous result stay when my expression has an error?
That is deliberate. When a query has a syntax error, the tool shows the engine’s original message in the result area instead of wiping your last working result. This keeps the view from flickering while you make successive edits, and the result returns as soon as the expression is valid again.
What happens when the JSON is invalid?
If the JSON on the left cannot be parsed, the tool shows the specific parse error beneath the input panel and holds off running the query, because matching against unparseable data is meaningless. Fix the JSON as prompted and the query resumes immediately.
Related tools
Keep going with the rest of the data and format toolkit.