Skip to content
TypeParser
All tools

JSONPath Tester

Run JSONPath queries against JSON.

beats jsonpath.com edge: Filter expressions + recursive descent + slicing
JSON
JSONPath
matches
paste JSON + path
Guide

About JSONPath Tester

Test JSONPath queries against your JSON live. Wildcards, array slicing, recursive descent, filter expressions — all supported. Each match shows its path and value, and the matched substrings highlight in the source for visual confirmation. Useful when extracting data from large API responses without writing code.

What JSONPath gives you

A way to extract values from a JSON document by path, without writing code. The syntax is dense but learnable in 20 minutes:

ExpressionMeaning
$The root
.foo or ['foo']Property foo
[0], [-1]Array index (negative counts from end)
[0:5]Array slice
*All elements
..fooRecursive descent — every foo at any depth
[?(@.age > 18)]Filter — items where the condition holds
[1, 3, 5]Specific indices

How to use the tester

  1. Paste JSON in the upper pane.
  2. Type a JSONPath query in the input.
  3. Watch matches appear in the result panel; each result shows the resolved path and value.
  4. Click a result to highlight the source location.

Common workflows

Extract from a large API response. A 5 MB response with the data you need three levels deep. $.data.items[?(@.status == 'active')].id pulls just the IDs.

Verify a webhook payload contains expected fields. $.event.user.email returns the email if present, empty otherwise. Quick sanity check before writing the parser.

Map fields for an ETL. Find the path to each desired field, write them down, transcribe to your transformation code.

Build assertions for tests. A test that says expect($.user.id).toBe('123') is more readable than walking the object manually. Some test runners accept JSONPath directly.

JSONPath in kubectl and Kubernetes

kubectl ships a built-in JSONPath output format for reading fields out of cluster objects without piping through jq:

kubectl get pods -o jsonpath='{.items[0].metadata.name}'
kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}'

Kubernetes’ implementation has quirks: the leading $ is optional, you wrap the whole expression in {}, and it uses range/end for iteration with custom separators. It does not support filters as richly as RFC 9535, so test the shape of your data here first, then translate to the {} syntax. Ranges look like:

kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.phase}{"\n"}{end}'

JSONPath in Python, Java, and RestAssured

Once a path works in the tester, drop it into code:

  • Pythonpip install jsonpath-ng, then parse("$.store.book[*].author").find(data) returns match objects; read .value off each. jsonpath_ng is the maintained fork most projects use.
  • Java (Jayway JsonPath)JsonPath.read(json, "$.store.book[-1].title"). Use Configuration with Option.DEFAULT_PATH_LEAF_TO_NULL when a leaf may be absent.
  • RestAssured — assert directly on a response body: response.then().body("store.book[0].title", equalTo("...")) (note RestAssured uses Groovy GPath, close to JSONPath but not identical — brackets and filters differ).

Filter and where-condition examples

JSONPath’s [?(...)] is the “where” clause:

GoalQuery
Where value equals$.users[?(@.role == 'admin')]
Where numeric compare$.items[?(@.price > 100)]
Multiple conditions$.users[?(@.age > 18 && @.active == true)]
Field exists$.users[?(@.email)]
Last element$.purchases[-1]

Why a tester beats a one-shot script

A throwaway script forces a context switch. The tester gives you immediate feedback — type, see results, iterate. Once the path is right, copy it into your real code. The same skill scales from one-off API debugging to production query writing.

Frequently asked questions

What is JSONPath?
A query language for JSON, modeled after XPath. Standardized as RFC 9535 (Feb 2024). The dollar sign $ is the root; dots traverse properties; brackets index arrays. Wildcards (*), recursive descent (..), and filters ([?(...)]) build expressive queries.
How does it differ from JMESPath?
JMESPath is a different (also JSON-targeted) query language used by AWS CLI. Closer to a functional pipeline. JSONPath is more XPath-like. Both extract data; pick by what your downstream tooling expects.
Can I use filter expressions?
Yes — $.users[?(@.age > 18)] selects all users older than 18. @ is the current element; standard comparisons (==, !=, <, >, <=, >=) and logical (&&, ||, !) work.
What does <code>..</code> do?
Recursive descent. $..price finds every property named price at any depth. Useful when the structure is nested and you do not want to write the full path.
Can I extract multiple paths at once?
Use $..[?(@.id == 1 || @.id == 2)] with logical operators. For unrelated selections, run two queries and merge results in code.
How do I get the last element of an array in JSONPath?
Use a negative index: $.purchases[-1] returns the last element, $.purchases[-2] the second-to-last. Negative indexing counts from the end and is supported by this tester and by most libraries (Python jsonpath-ng, Jayway JsonPath). If a library predates RFC 9535 and rejects [-1], use a slice like $.purchases[-1:] instead.
What happens when a JSONPath is missing — can I set a default value?
JSONPath itself returns an empty result set when a path does not match; there is no built-in default. In code you supply the fallback: Jayway JsonPath has the DEFAULT_PATH_LEAF_TO_NULL and SUPPRESS_EXCEPTIONS options, and Python jsonpath-ng returns an empty list you can coalesce with or default. This tester simply shows zero matches so you can confirm the path before wiring in a default.
Is the query running in my browser?
Yes — all parsing and evaluation happen client-side. Your JSON never leaves the page.

Related tools

Last updated: 2026-07-04