Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

JSONPath Tester and Evaluator

Try JSONPath queries on JSON and see what they match.

Cheat sheet

Click an expression to try it. The examples suit the sample store data.

Use via API

Evaluate a JSONPath expression against JSON and return every match with its normalised path, JSON Pointer and value. Filters such as [?(@.price < 10)] run in a safe interpreter (no eval). Send JSON, get JSON back.

POST https://pithlab.com/api/v1/tools/jsonpath-tester

curl https://pithlab.com/api/v1/tools/jsonpath-tester \
  -H "Authorization: Bearer $PITHLAB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"{\"store\":{\"book\":[{\"title\":\"Dune\",\"price\":9.99},{\"title\":\"Emma\",\"price\":12.5}]}}","path":"$.store.book[?(@.price < 10)].title"}'

Fields and responseOpenAPI documentGet an API key

About the JSONPath Tester

Test JSONPath expressions against your JSON and see the matching values and their paths, with a clickable syntax cheat sheet. Runs safely in your browser.

How to use the JSONPath Tester

  1. Paste your JSON into the JSON input box, or load the example store data.
  2. Type a JSONPath expression starting with $, such as $..book[?(@.price < 10)].title.
  3. Results update as you type: the matching values as formatted JSON, plus the path and JSON Pointer of each match.
  4. Click any expression in the cheat sheet to try it, then copy or download the results.

Examples

Select a nested value

Input

{"user": {"name": "Ada", "langs": ["en", "fr"]}} with $.user.langs[0]

Output

[
  "en"
]
Filter an array

Input

{"items": [{"id": 1, "price": 5}, {"id": 2, "price": 15}]} with $.items[?(@.price > 10)].id

Output

[
  2
]
Recursive descent

Input

{"a": {"name": "x"}, "b": [{"name": "y"}]} with $..name

Output

[
  "x",
  "y"
]

Frequently asked questions

What is JSONPath?

A query language for JSON, similar to XPath for XML. $ is the root, a dot or brackets select keys, [*] selects every item, .. searches at any depth and ?() filters by a condition. It is now standardised as RFC 9535.

Are filter expressions safe to run?

Yes. Filters run in a small built-in interpreter, not with eval, and access to constructors and prototypes is blocked. Everything happens in your browser and nothing is sent anywhere.

What is the difference between the path and the pointer?

The path is the normalised JSONPath of each match, such as $['store']['book'][0]. The pointer is the same location as a JSON Pointer (RFC 6901), such as /store/book/0, used by JSON Patch and JSON Schema.

Which JSONPath implementation is used?

jsonpath-plus, which supports the original Goessner syntax plus extras such as ~ for property names and the @parent and @property filter variables.

Why do I get an empty array?

The expression is valid but nothing matched. Check key names and letter case, remember that array indexes start at 0, and try $..key to search at every depth.