JSONPath Tester

Test JSONPath expressions against a JSON document. Live results, common presets, no data leaves your browser.

Runs 100% client-side
Copy output
On this page4 sections
JSON document

Results

0 matches found
No matches yet — try one of the presets.

HOW TO USE

  1. 01Paste your JSON document on the left.
  2. 02Type a JSONPath expression on the right or click a preset to start. Results update live as you type.
  3. 03Common operators: $ (root), . (child), .. (recursive descent), [*] (all items), [?(@.field=='x')] (filter).

WHEN TO USE

Use this any time you need to write a path-based assertion for a JSON API response and you're not sure the path is correct. Validate the expression against the real payload before putting it in a test — a typo in the path returns undefined silently, which may cause a false pass. Also use it to explore an unfamiliar response structure by trying different expressions live rather than reading the raw JSON.

WHAT BUGS THIS FINDS

  • Silent assertion on wrong path

    $.data.user.id hits undefined when the actual path is $.data.userId — the assertion may evaluate to truthy/undefined and never fail, masking the real value.

  • Array index assumptions

    Hardcoded $.items[0].price breaks when the API reorders results — switching to a filter expression [?(@.id=='x')] is more robust; the tester confirms both paths before committing.

  • Recursive descent vs dot notation

    $.store..price finds prices at any depth; $.store.price only matches the top-level key — the tester shows which one matches your actual data.

  • Filter predicate syntax errors

    JSONPath filter expressions vary by library; testing the expression before embedding it in test code prevents runtime syntax errors or empty match sets.

QA USE CASES

01

API assertion path validation

Paste the actual response, type the JSONPath you plan to use in your test assertion, and confirm the returned value before writing the test.

02

Response exploration

Use recursive descent ($..) to discover all occurrences of a key name across a deeply nested response when you don't yet know the exact path.

03

Filtered list testing

Build a filter expression like [?(@.status=='active')] to assert only on the records that match a condition, rather than a brittle index-based path.