DevTools Hub

Search tools

Search for a developer tool

JSON

JSONPath Tester

Test a JSONPath expression against a JSON document and see every match, live.

Part of the JSON Toolkit
2 matches
  • $['store']['book'][0]['title']
    "Dune"
  • $['store']['book'][1]['title']
    "The Hobbit"

What this does

Paste a JSON document, type a JSONPath expression, and see every match — its value and its full resolved path — update as you type. JSONPath is to JSON what a CSS selector is to HTML: instead of writing code to walk a document, a single expression like $..book[?(@.price<10)].title picks out exactly the nodes you want.

Syntax reference

SyntaxMeaning
$The root of the document. Every expression starts here.
.nameChild property access, e.g. $.store.bicycle.
..nameRecursive descent — finds name at any depth, e.g. $..author.
*Wildcard — every property of an object or every element of an array.
[0], [-1]Array index. Negative indices count from the end.
[0,1]Index union — multiple specific indices at once.
[start:end:step]Array slice, same semantics as Python slicing.
[?(expr)]Filter — keeps elements where expr is true. @ refers to the current element, e.g. [?(@.price<10)].
[(expr)]Script expression evaluated against the current node, e.g. [(@.length-1)].

Common examples

Using the sample data loaded above:

FAQ

Why does an expression return no matches instead of an error?

A path segment that simply doesn't exist in the document (a typo'd property name, an out-of-range index) is not an error in JSONPath — it just matches nothing. An error is only shown when the expression itself can't be parsed, like an unterminated filter.

What implementation does this use?

This tool runs JSONPath Plus, a JavaScript implementation of Stefan Goessner's original JSONPath with filter expressions and script expressions added. Entirely in your browser — nothing you paste in is sent anywhere.

Try it yourself

New to JSONPath itself? What Is JSONPath? covers where it came from and how it differs from JSON Pointer, JMESPath, and jq. Need to check the document's shape instead of querying into it? See JSON Formatter and JSON Schema Validator.

Related tools