JSONPath Tester

Paste a JSON document and type a JSONPath expression like $..book[?(@.price<10)]. The tester evaluates it against the document and shows every matching value, with the exact path of each match. Useful for validating the query you are about to paste into a script or an API spec (Postman, k6, JMeter all speak JSONPath).

How to test a JSONPath expression

  1. 1

    Paste the JSON document

    Any valid JSON: object, array, deeply nested.

  2. 2

    Type the expression

    Start with `$` for root. Use `.` for child, `..` for recursive descent, `[*]` for wildcard.

  3. 3

    See the matches live

    Each match is shown with its value and full JSONPath, highlighted in the original document.

  4. 4

    Copy the results

    Copy matches as a JSON array, or copy each individual path for use in downstream code.

JSONPath syntax reference

Expression Meaning
$ Root element
$.store Child of $ named store
$["store"] Same, bracket form
$..author All author properties at any depth
$.store.book[*] Every book in the store
$.store.book[0] First book
$.store.book[-1:] Last book
$.store.book[0:2] First two books (slice)
$.store.book[?(@.isbn)] Books with an isbn property
$.store.book[?(@.price < 10)] Books cheaper than 10
$.store.book[?(@.category == "fiction")] Fiction books
$..* Every value, everywhere

Filter expressions

Filter expressions use @ to refer to the current node. The tester supports the common operators ==, !=, <, >, <=, >=, &&, ||, and regex =~.

$.items[?(@.qty >= 10 && @.price < 50)]

JSONPath dialects

There are several JSONPath implementations with small incompatibilities. This tester follows the Goessner original spec and the RFC 9535 refinements, which are compatible with:

  • Jayway JsonPath (Java)
  • jsonpath-plus (JavaScript)
  • jsonpath-rw (Python)
  • jq basic path expressions

Incompatible features (like script expressions with arbitrary JS) are flagged in the error panel.

When JSONPath beats a full parser

  • Test assertions: Postman’s pm.expect(jsonData).to.have.jsonPath(...) takes a path.
  • Config extraction: pull one value out of a huge API response without a library.
  • Load-testing scripts: k6, JMeter and Gatling all support JSONPath for checks.
  • Kubernetes / AWS CLI: --query and --jsonpath flags let you shape output from the command line.

Common mistakes

  • Using . on an array. $.users.0.name is wrong; use $.users[0].name.
  • Forgetting .. for depth. A path like $.name only matches top-level name; use $..name for all.
  • Confusing JSONPath with jq. jq is a superset with control flow and transformations; JSONPath is purely for extraction.
  • Regex anchoring. =~ /foo/ matches substrings; use /^foo$/ for exact.

Frequently Asked Questions

JSONPath is a pure extraction language, select, filter, slice. jq is a full query / transformation language with control flow, variables and functions. For simple extraction, JSONPath is more portable; for transformations, use jq.

The Goessner original spec plus the RFC 9535 refinements, matching Jayway JsonPath (Java) and jsonpath-plus (Node). Dialect-specific extensions (script expressions with arbitrary code) are not supported.

Yes. $..book[?(@.title =~ /^Harry.*/)] matches all books whose title starts with “Harry”. Use ^ and $ for full-match behaviour.

Yes. Both the JSON and the JSONPath evaluator live in your browser. Your document and queries never leave the tab.

Related Tools

Tool available in other languages