Skip to content
SDETRole
SDETRole

JSON & Data

JSONPath Tester

Try JSONPath expressions on real JSON and see every match and path.

Runs entirely in your browser No sign-up

JSON document

0 chars

Result

Paste JSON or load the sample, then type an expression

Results update as you type. Filter expressions are evaluated by a safe interpreter, never with eval.

Syntax cheatsheet

ExpressionMeaningAction
$Root of the document
$.store.bicycleChild by name (dot notation)
$['store']['book']Child by name (bracket notation, for keys with spaces or dashes)
$..authorRecursive descent: every "author" at any depth
$.store.*Wildcard: all children
$.store.book[0]Array index (0-based)
$.store.book[-1:]Last element (slice)
$.store.book[0,2]Union of indexes
$.store.book[1:3]Slice: index 1 up to (not including) 3
$.store.book[?(@.price < 10)]Filter: elements matching a condition
$..book[?(@.isbn)]Filter: elements that have a truthy "isbn"
$..book[?(@.category == 'fiction' && @.price > 10)]Combined conditions with && and ||
$.store.*~Property names instead of values (jsonpath-plus extension)

Filters support @ and $ references, strings, numbers, true/false/null, == != < <= > >=, &&, || and !. Script expressions such as [(@.length-1)] and function calls are not executed.

About this tool

JSONPath is how most API test frameworks pick values out of a response: REST Assured’s JsonPath, Postman scripts, Karate and many assertion libraries use the same ideas. Writing the expression against a live response saves a round of failed test runs. This tester uses jsonpath-plus with script evaluation turned off, and evaluates filter expressions such as [?(@.price < 10)] with a small built-in interpreter, so nothing you paste is ever executed as code. Every match is shown with its normalised path, which tells you exactly where the value came from.

How to use it

  1. Paste a JSON response into the left panel, or click “Load sample” for the classic bookstore document.
  2. Type an expression starting with $; results update as you type.
  3. Choose whether to show values, paths or both, then copy the result.
  4. Use the cheatsheet’s “Try” buttons to see recursive descent, slices, unions and filters in action.

JSONPath Tester FAQ

Why does my expression work here but not in REST Assured?

REST Assured uses Groovy GPath, not Goessner JSONPath. The path “store.book.findAll { it.price < 10 }.title” in GPath is equivalent to “$.store.book[?(@.price < 10)].title” here. Simple dotted paths are the same in both, but filters and wildcards use different syntax.

Which filter syntax is supported?

Filters can reference the current item (@) or the root ($), compare with == != < <= > >=, combine with && || and !, and use strings, numbers, true, false and null. Script expressions like [(@.length-1)] and JavaScript method calls are deliberately not executed; use the slice [-1:] for the last element.

Why do I get no matches even though the key exists?

The usual causes are case differences (userId vs userid), missing [*] when the value is inside an array, or a key with a dash or space that needs bracket notation such as $['first-name'].

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →