DevGrill

JSONPath Tester

Run JSONPath queries on your JSON and see every match highlighted.

Runs in your browser

Try:
JSONPath cheat sheet
$The whole document (every query starts here)
.name or ['name']A member of an object
[0] [-1]An array item, counting from the end with minus
[0:2] [::2]A slice: start, end (not included), step
* [*]Every member or item
..namename at any depth
[0,2] ['a','b']Several selectors at once
[?@.price < 10]A filter; @ is the item being tested
[?@.isbn]Items that have an isbn
&& || !And, or, not (with parentheses for grouping)
length(@.x) count(@.*)Text length or array size; number of matches
match(@.x, 'a.*') search(@.x, 'a')Whole-text or partial regex match
0 chars
Matches

Paste JSON and type a query. Matches will sizzle here.

What JSONPath is for

JSONPath picks values out of JSON, the way a file path picks a file. $.store.book[0].title is the first book's title; $..price is every price at any depth; $.store.book[?@.price < 10] is every book under 10. It's used in API tests (Postman, REST Assured), Kubernetes kubectl -o jsonpath, AWS Step Functions, and log and monitoring tools.

Type a query and every match is highlighted in your JSON and listed on the right with its exact path, like $.store.book[2].title. Click a match to jump to it. The syntax follows RFC 9535, the JSONPath standard, so a query that works here works in any tool that follows it.

How to use the JSONPath Tester

  1. Paste your JSON. Or load the sample, a small bookstore, to try the examples.

  2. Type a query. It starts with $, the whole document. Results update as you type; a mistake is explained under the box.

  3. Check the matches. Each shows its path and value. Click one to scroll the JSON to it.

  4. Copy the result. Copy copies every matched value as a JSON array.

Tips

  • Names with spaces or symbols need brackets and quotes: $['first name'].
  • Filters test each item with @: [?@.age >= 18 && @.active == true]. Use ! for not, like [?!@.deleted].
  • [(@.length-1)] is old JSONPath (script expressions) and isn't part of the standard. Use [-1] for the last item.
  • Big numbers stay exact, so $.id on 12345678901234567890 returns it unchanged.

Frequently asked questions

Which JSONPath syntax is supported?

RFC 9535: names, wildcards, indexes (including negative), slices, .. descendants, filters with comparisons, &&, ||, ! and parentheses, and the functions length(), count(), match(), search() and value().

Why does my query from another tool not work here?

Older JSONPath versions (Goessner, Jayway) allowed extras such as script expressions [(...)], ?() filters without @ and functions like .length(). They differ between libraries; RFC 9535 is the one standard. The error message under the query says what to change.

What's the difference between match() and search()?

match(@.code, 'A.*') needs the whole text to match the regex; search(@.title, 'of') only needs it to appear somewhere.

Is my JSON sent anywhere?

No. Queries run in your browser, so it's safe for real API responses.

Related tools