Skip to content
gohacks.dev
APIs

JSONPath Tester

Run JSONPath queries against a JSON document: child and recursive descent, wildcards, indexes, slices and filters such as [?(@.price < 50)].

Free · No sign-up · Your inputs stay in your browser

Input

Test a JSONPath query

Output

Matches

2 matches

Follows RFC 9535 for the selectors listed. The same paths work in kubectl -o jsonpath and, without the leading $, close to what jq and MySQL's JSON_EXTRACT accept.

Runs in this browser. Nothing you paste is sent to a server.

A standard since 2024

JSONPath began as a 2007 blog post and spread through many slightly different implementations until the IETF published RFC 9535 in 2024. Filters in the RFC are written $[[email protected] < 50]; the older form with parentheses, [?(@.price < 50)], is accepted here too because most existing tools use it.

Where you meet it

kubectl get pods -o jsonpath='{.items[*].metadata.name}' uses a JSONPath dialect without the leading $. MySQL's JSON_EXTRACT(doc, '$.a.b') and PostgreSQL's jsonb_path_query() use path languages that start the same way and differ in details.

Share

Frequently asked questions

What does .. do in JSONPath?
It searches at any depth. $..price returns every price field anywhere in the document.
How do I filter an array by a field?
Use a filter: $.store.books[?(@.price < 50)] returns the books whose price is under 50. [?(@.isbn)] keeps only items that have an isbn.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools