JSON Query with JSONPath
Query JSON with JSONPath: wildcards, recursive descent, slices and filter expressions like [?(@.price < 10)]. Results update as you type. Not jq syntax.
$ is the root; .name or ['name'] selects a child; [0] an array item; [*] all items; .. searches at any depth; [?(@.price < 10)] filters; [-1:] takes the last item.
Runs entirely in your browser. Your data is never uploaded.
Related Tools
View AllWhat is JSON Query (JSONPath)?
The JSON Query tool evaluates JSONPath expressions against your JSON and shows every matching value as a JSON array. It supports wildcards, recursive descent, array slices and filter expressions. Note: it uses JSONPath syntax ($.store.book[*].title), not jq's pipe syntax.
How to use JSON Query (JSONPath)
- Paste JSON into the JSON input box (or click an example, which also loads sample data).
- Type a JSONPath expression, for example
$..price. - Read the matching values in the output; the label shows how many matched.
- Copy the result array with Copy.
Example
{"store":{"book":[{"title":"A","price":8},{"title":"B","price":12}]}}
Query: $.store.book[?(@.price < 10)].title [ "A" ]
When to use JSON Query (JSONPath)
Use it to test JSONPath expressions before using them in tools that accept JSONPath (API gateways, Kubernetes kubectl -o jsonpath, test frameworks, monitoring). If you need jq features such as pipes, map, or object construction, use jq itself – those are not supported. For a single exact path, the JSON Path Finder is simpler.
How JSON Query (JSONPath) works
Queries are evaluated with the jsonpath-plus library (Goessner JSONPath plus extensions). $ is the root, .name or ['name'] selects a property, [0] an index, [*] all children, .. searches at every depth, [start:end] slices arrays (negative indexes count from the end) and [?(…)] filters with @ as the current item. Filter expressions run in jsonpath-plus's safe evaluator, which supports comparisons and logical operators but does not execute arbitrary JavaScript. The result is always an array of matches, printed with 2-space indentation.
Common Use Cases
- Extracting all prices or ids from an API response
- Testing JSONPath for API tests or monitoring rules
- Filtering array items by a condition
- Prototyping kubectl jsonpath-style queries
Security Note
Everything runs locally in your browser; the code you paste is not uploaded.
FAQs
Is this jq?
No. It uses JSONPath, a different query language. jq pipes and functions are not supported.
Why is the result always an array?
A JSONPath expression can match any number of values, so all matches are returned in an array.
Is my JSON sent to a server?
No, the query runs in your browser.
Do large numbers lose precision here?
Yes, values are evaluated as JavaScript numbers, so integers above 2^53 may be rounded in query results.