🛠️ Developer & Web

JSONPath Tester

Write a JSONPath query and see what it matches.

  • jsonpath-plusengine
  • 3output views
  • 8one-click examples
  • Liveas you type

How to use the JSONPath Tester

  1. 1

    Paste your JSON

    Replace the bookstore sample with your own document; it is saved locally for next time.

  2. 2

    Write an expression

    Start with $ and build the path, or click one of the example chips to load it.

  3. 3

    Choose a view

    Show matched values, normalised paths, or both together.

  4. 4

    Copy the result

    Use Copy result, then paste the expression into your test, config or kubectl command.

Features

Instant feedback

The result refreshes a moment after you stop typing in either box.

Normalised paths

Paths view shows each match as $['orders'][0]['id'], so you know exactly where it came from.

Filters with logic

Filter expressions can combine conditions with && and compare nested fields.

Slices and negatives

Use [0:2], [-1:] and similar to pick ranges from arrays.

Match counter

The result label shows how many matches the expression produced.

Private

Evaluation runs in your browser.

Who uses it — and for what

API testers

Build assertions for Postman, REST Assured or Karate.

Kubernetes users

Prototype paths for kubectl -o jsonpath output.

Monitoring setups

Check the path an alerting rule or uptime check will read.

Integration builders

Pick fields out of webhook payloads in low-code tools.

JSONPath syntax

ExpressionMeaning
$The root object
.key / ['key']Child property
[0], [-1]Array index (negative counts from the end)
[*] / .*All children
..keyRecursive descent — every “key” at any depth
[0:3]Slice: items 0, 1 and 2
[?(@.price < 10)]Filter items by a condition

Where JSONPath is used

JSONPath extracts values from JSON in API testing tools (Postman, REST Assured, Karate), Kubernetes kubectl -o jsonpath, AWS Step Functions, monitoring and alerting rules, and data pipelines. Test an expression here before putting it in a config. Results show the matching values or their normalised paths. Evaluation uses the jsonpath-plus library in your browser.

Everything runs in your browser — your code and data are never uploaded, so it is safe to paste private config files and API responses.

Writing filters that work

Filters are where most JSONPath time goes. Inside [?( … )], the @ symbol stands for the current array element, and the expression decides whether it is kept.

  • Existence: [?(@.coupon)] keeps items that have a truthy coupon. Beware that a value of 0, "" or false also counts as “not there” in this engine.
  • Comparisons: ==, !=, <, <=, >, >=. Compare strings with quotes, numbers without.
  • Combining: && and || join conditions; nested fields such as @.customer.city work inside the filter.
  • After the filter: keep navigating — [?(@.status == "paid")].items[*].qty returns the quantities of items in paid orders only (here [2, 1], since order A3 has no items).

This tester uses jsonpath-plus, whose filters accept JavaScript-style syntax, including === and single-quoted strings. Other implementations are stricter. RFC 9535, published in 2024, standardises JSONPath; if your expression will run in another engine, stick to simple comparisons, &&, || and plain property access, and test it there too.

Dialect differences to watch for

FeatureHere (jsonpath-plus)Elsewhere
$.orders.lengthReturns the array lengthOften no match: length is not a key in the JSON
[?(@.x)] existence testTruthinessRFC 9535 tests for presence, so 0 and false still match
Filter syntax[?(@.a > 1)] with parenthesesRFC 9535 also allows [?@.a > 1]
kubectl—Wraps expressions in braces, e.g. {.items[*].metadata.name}, and the leading $ is optional
Result shapeAlways a list of matchesSome tools return a single value when there is one match

So treat this page as a fast way to explore your data and draft expressions, then confirm the final expression in the tool that will run it.

Worked examples

Queries on an orders document

Data used for every row: three orders, A1 (paid, total 450, city Pune, items TEA and MUG), A2 (pending, total 1299.5, city Delhi, item KETTLE) and A3 (paid, total 89, city Pune, no items, coupon DIWALI).

ExpressionResult
$.orders[?(@.status == "paid")].total[450, 89]
$..sku["TEA", "MUG", "KETTLE"]
$.orders[?(@.total > 400 && @.customer.city == "Pune")].id["A1"]
$.orders[-1:].id["A3"]
$.orders[?(@.coupon)].id["A3"]
$.orders[0:2].customer.city["Pune", "Delhi"]
$.orders.length[3]
$.Orders[*].idNo matches — keys are case-sensitive

Paths and values together

With Paths and values selected, $..sku returns:

[
  { "path": "$['orders'][0]['items'][0]['sku']", "value": "TEA" },
  { "path": "$['orders'][0]['items'][1]['sku']", "value": "MUG" },
  { "path": "$['orders'][1]['items'][0]['sku']", "value": "KETTLE" }
]

(Shown slightly condensed.) The normalised path is handy when a recursive query matches more than you expected and you need to see which branch each value came from.

Pro tips

  • Use .. sparingly on big documents: recursive descent visits every node and can return matches from places you did not expect.
  • Keys with dashes or spaces need bracket notation: $['order-id'] or $["order-id"].
  • When a path returns nothing, cut it back one step at a time until it matches, then add segments again.

Glossary

JSONPath
A path language for selecting parts of a JSON document, standardised as RFC 9535.
Recursive descent
The .. operator, which searches every level below the current node.
Filter expression
A [?(…)] condition that keeps only array elements for which it is true.
Normalised path
A unique path to one value, written with bracket notation for every step.

Frequently asked questions

Is JSONPath the same as jq?

No — jq is a full query language; JSONPath is a simpler path syntax, now standardised as RFC 9535.

How do I filter by a string?

Use quotes: $..book[?(@.category == "fiction")]

Why is my result empty?

Check property names are case-sensitive and that you start from $.

Can I select several keys at once?

Yes. In this engine, list the names without quotes inside one bracket: $.orders[*][id,total] returns each order’s id and total in turn. A quoted list such as ['id','total'] returned no matches when we tried it.

Does it support regular expressions in filters?

jsonpath-plus filters are JavaScript-like, so expressions such as @.sku.match(/^K/) may work here, but they are not portable to other JSONPath engines.

Why does the result always look like an array?

The tester wraps results as a list of matches, even when there is only one, so the output shape stays predictable.

Found it useful? Share the JSONPath Tester:

Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)