DevToolsHub Free · Fast · 100% in your browser

JSONPath Tester

Query JSON with JSONPath expressions and see the matching values.

3 match(es)

[
  "Nigel Rees",
  "Evelyn Waugh",
  "Herman Melville"
]

About this JSONPath tester

Evaluate JSONPath expressions against your JSON and see the matching values instantly. JSONPath is to JSON what XPath is to XML: a query language for selecting values inside a document. It is used in Postman tests, Kubernetes (kubectl -o jsonpath), AWS Step Functions and EventBridge, Azure Logic Apps, Spring, Jayway, Newtonsoft.Json SelectToken, jq-style pipelines and many API gateways. Use this tester to prototype an expression before putting it in code, or to pull a single value out of a large API response.

How to use the JSONPath Tester

  1. Paste your JSON document.
  2. Enter a JSONPath expression such as $.store.book[*].author or $..price.
  3. View the matched values and their count as you type.

Example

$.store.book[?(@.price < 10)].title  →  titles of all books cheaper than 10
$..author                             →  every author at any depth
$.store.book[0]                       →  the first book
$.store.book[-1:]                     →  the last book
$.store.book[*].isbn                  →  all ISBNs (missing ones skipped)

Frequently asked questions

What is the JSONPath syntax?

$ is the root, . or [''] selects a child, [n] selects an array index, [*] selects all elements, .. descends recursively, [start:end] slices an array and [?(expr)] filters elements using @ as the current item. For example $.users[?(@.age > 30)].name returns the names of all users older than 30.

What does $.. mean?

The recursive descent operator searches for the property at every depth of the document. $..id returns every id field anywhere, no matter how deeply nested.

How do I filter an array with JSONPath?

Use a filter expression in square brackets: $.items[?(@.status == 'active')] keeps only items whose status is active. Comparisons (==, !=, <, >, <=, >=), logical && and ||, and regex matching with =~ are supported.

How do I get the last element of an array?

Use a negative slice: $.items[-1:] returns the last element, $.items[-2:] the last two. $.items[0] returns the first element.

How do I select a key that contains a dot or a space?

Use bracket notation with quotes: $['my.key'] or $.data['first name']. Dot notation only works for simple identifiers.

What is the difference between JSONPath and jq?

JSONPath is a selection language: it returns the values that match a path. jq is a full transformation language with functions, arithmetic and output shaping. If you only need to extract values, JSONPath is simpler and is supported natively in far more products.

Why does my expression return nothing?

The most common causes are a missing $ at the start, a case mismatch in a property name (JSONPath is case-sensitive), using dot notation on a key with special characters, or quoting the whole expression. Check the matched count shown under the input while you type.

Is my data safe?

Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.

Is it free?

Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.

An unhandled error has occurred. Reload ✕