$.path[*] · filters · descendants

Test JSONPath expressions live

Filter, descend, and slice into JSON with the classic $.dot.path[*][?(@.cond)] syntax. Live preview as you type.

JSONPath Tester Workspace
Input size
315 B
10 lines
Output size
49 B
3 matches
Path
$.store.books[*].title
22 chars
Status
OK
JSONPath subset
JSONPath
input · json
output · matches
[
  "Atomic Habits",
  "Deep Work",
  "Sapiens"
]
Quick Start

How to query JSON with JSONPath

JSONPath is an XPath-like syntax for JSON. Useful when you need a quick read-only query into a document — paths like $.store.books[*].title, descendants $..price, filters $..books[?(@.price<20)].

  1. 01

    Paste JSON

    Drop a document and start with $ (the root).

    Inputs parse through the native JSON.parse reviver chain — strict RFC 8259. Any syntax error returns line and column for the exact offending byte.

    root: $RFC 8259JSON.parsestrictlive
    input · raw.json · RFC 8259
    {"store":{"books":[{"title":"X"}]}}
    loaded · parsed RFC 8259RFC 8259 · ready
  2. 02

    Write a path

    Drill in with .field, expand with [*], descend recursively with .., slice with [1:3], filter with [?(@.cond)].

    $.field$..deep[?(@.x>1)]
    pathexpr
    $.store.books[*].title
    valid
  3. 03

    Inspect matches

    Each path can return multiple values — output is a JSON array.

    Large documents stream through a useMemo with stable hashing so options re-apply instantly — no full re-parse if only formatting changes.

    arraymatchesmemoisedinstantdiff-friendly
    matches · rendered3 · ready
    ["Atomic Habits","Deep Work","Sapiens"]
    rendered · livediff-friendly
  4. 04

    Copy or download

    Compare with JQ Playground for a richer query language.

    Download is a Blob with application/json; copy uses the Async Clipboard API. Both round-trip identically to what the page rendered.

    copydownloadclipboardblob.json
    export · copiedready · done
    ✓ Copied
    ✓ Saved
    shipped · ready to shipsuccess
Pro tips

Production-grade JSON, the right way

Stick to RFC 8259

Strict JSON has no NaN, Infinity, comments, or trailing commas. If you need those, look at JSON5 or JSON Repair.

Preserve key order for diffs

JavaScript preserves insertion order, but two parsers shouldn’t be assumed equal. Use Sort JSON Keys before diffing or hashing.

Big integers lose precision

JS numbers lose precision past 2^53−1. Transport large IDs as strings or use BigInt.

Escape inside HTML

When inlining JSON inside <script>, escape </ to <\/ so HTML parsing doesn’t close your tag early.

Validate at boundaries

Trust the wire as little as possible. Run incoming JSON through a schema (Zod / Pydantic) before it touches business logic.

Minify in production

Minify removes whitespace; gzip removes redundancy. Together they typically shrink JSON payloads 70–85% over the wire.

Use Cases

When to use JSONPath

Quick read-only queries where jq would be overkill.

API exploration

Probe deep into a response without writing a script. Output round-trips losslessly through JSON.parse + JSON.stringify, so the file you save is byte-identical to what you see. Streaming parsers, jq pipelines, and Postgres jsonb columns all accept the result without complaint.

10× faster to scan

Test assertions

Many libraries (Postman, REST-assured) use JSONPath for response assertions. Pairs perfectly with sort-keys + diff for review-friendly fixtures in CI. Whitespace-only churn disappears and reviewers see real changes, which keeps PR comments focused on logic rather than indentation.

cleaner PR diffs

k8s manifests

kubectl supports -o jsonpath=... for field selection.

k8s-friendly

OpenAPI / Swagger

Reference path objects with JSONPath expressions inline. Re-parses on every keystroke so syntax errors are caught at the exact character. Strict RFC 8259 — no trailing commas, no comments, no unquoted keys — keeps downstream parsers happy.

round-trip safe

Webhook routing

Extract subset fields from a webhook for downstream consumers. Streams large documents without a server round-trip — privacy stays in the tab. Heavy parsing runs through useMemo so even 5 MB payloads keep the editor responsive.

schema-friendly

Log filtering

Pull a specific field from structured logs for further analysis. Output is byte-stable: same input plus same options always produces identical bytes, ideal for content-addressed caches and snapshot tests. Downloads ship with the application/json MIME so editors apply syntax highlighting.

production-ready
FAQ

Frequently asked questions

Classic JSONPath (Stefan Goessner's spec) — $.field, $..deep, [*], [n], [a:b:c], [?(@.cond)]. Some advanced features (script expressions, unions) are not supported.
Comparison filters like @.price < 20 work. JS expressions inside filters are evaluated in a sandbox.
JSONPath is read-only and simpler; jq is a full transformation language with pipes, comma streams, and custom functions.
Tens of MB work; deeply nested descendants (..) can be slow on very large inputs.
No. All processing runs locally.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!