JSON Path Evaluator
Evaluate JSONPath expressions against JSON data in real time — supports dot notation, recursive descent, array slicing, wildcards, and filter expressions
Enter a JSONPath expression and paste JSON above to see matching results.
JSONPath Syntax Reference
$Root element.propertyChild property..propertyRecursive descent (any depth)[*]All array elements or object values[0]Array element at index 0[-1]Last array element[0:2]Array slice (index 0 and 1)[0:5:2]Slice with step (0, 2, 4)[?(@.price < 10)]Filter: price less than 10[?(@.isbn)]Filter: nodes that have an isbn field[?(@.cat == "sci")]Filter: category equals sci['key']Bracket notation for property access[0,2]Union: index 0 and 2$.*All children of root$..*All nodes in documentYour API returns a 500-line JSON response and you need all product names where the price is over $50. You could write a JavaScript loop, or you could use a JSONPath expression: $.products[?(@.price > 50)].name. But you’re not sure if the filter syntax is ?(@.price > 50) or ?(@['price'] > 50), and you need to test the expression before embedding it in your code.
Why This Evaluator (Not the JSON Path Finder)
PureDevTools has two JSONPath tools. This one lets you write and test JSONPath expressions against JSON data with real-time results — supporting $, dot notation, recursive descent, array slices, wildcards, and filter expressions. The JSON Path Finder lets you click values in a tree to get their path. Use this evaluator to query; use the finder to discover paths.
What Is JSONPath?
JSONPath is a query language for JSON, similar to how XPath queries XML documents. It allows you to extract specific values from any JSON structure using a compact expression syntax. JSONPath was originally proposed by Stefan Goessner in 2007 and has since become the standard way to navigate and query JSON data.
JSONPath expressions are widely used in:
- API testing (Postman, REST-assured, Karate): Assert that a response field equals an expected value
- Configuration processing: Extract specific settings from complex JSON configs
- Data transformation pipelines: Select fields to pass to the next stage
- AWS CloudFormation and serverless frameworks: Reference outputs and parameters
- Kubernetes and Helm: Navigate manifest values
JSONPath Syntax Reference
Every JSONPath expression starts with $, which represents the root of the JSON document.
Dot Notation
The simplest way to access object properties:
$.store.name → value of store.name
$.user.address.city → deeply nested property
Bracket Notation
An alternative to dot notation, required for keys with special characters or spaces:
$['store']['name'] → same as $.store.name
$['my-key'] → key with a hyphen
$["first name"] → key with a space
Array Access
$.items[0] → first element (zero-indexed)
$.items[1] → second element
$.items[-1] → last element (negative index)
$.items[-2] → second-to-last element
Wildcard [*] and .*
Match all elements or all properties:
$.store.book[*] → all books in the array
$.store.* → all values in the store object
$.* → all top-level values
$..* → every node in the entire document
Array Slice [start:end:step]
Python-style slice notation:
| Expression | Meaning |
|---|---|
[0:3] | Elements at index 0, 1, 2 |
[1:] | All elements from index 1 onward |
[:3] | First 3 elements (index 0, 1, 2) |
[-2:] | Last 2 elements |
[0:6:2] | Every 2nd element: index 0, 2, 4 |
[::-1] | All elements in reverse order |
Recursive Descent ..
The .. operator searches for a key at any depth in the document — no matter how deeply nested:
$..author → every "author" property anywhere in the document
$..price → every "price" at any depth
$.store..price → every "price" inside store, at any depth
Filter Expressions [?(...)]
Select elements that satisfy a condition. Inside the filter, @ refers to the current element being tested:
$.book[?(@.price < 10)] → books cheaper than $10
$.book[?(@.isbn)] → books that have an isbn field
$.book[?(@.category == "fiction")]→ only fiction books
$.users[?(@.age >= 18)] → adult users
$.items[?(@.active == true)] → active items only
$.products[?(@.name =~ /^mac/i)] → products matching a regex
Supported comparison operators:
| Operator | Meaning |
|---|---|
== | Equal |
!= | Not equal |
< | Less than |
<= | Less than or equal |
> | Greater than |
>= | Greater than or equal |
=~ | Regex match |
Union [a,b]
Select multiple specific indices or keys at once:
$.book[0,2] → first and third books
$.item['name','price'] → name and price of an item
Classic Bookstore Examples
The canonical JSONPath examples use this bookstore JSON:
{
"store": {
"book": [
{ "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 },
{ "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 },
{ "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 },
{ "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 }
],
"bicycle": { "color": "red", "price": 19.95 }
},
"expensive": 10
}
| Expression | Result |
|---|---|
$.store.book[*].author | All 4 authors |
$..author | All authors (same result via recursive descent) |
$.store.* | All items in store (book array + bicycle object) |
$.store..price | All prices in store (5 values) |
$.store.book[2] | Third book (Moby Dick) |
$.store.book[-1] | Last book (The Lord of the Rings) |
$.store.book[0,1] | First two books |
$.store.book[0:2] | First two books (slice) |
$.store.book[?(@.isbn)] | Two books that have an isbn |
$.store.book[?(@.price < 10)] | Two books under $10 |
$..price | All 5 prices anywhere in the document |
How to Use the JSONPath Evaluator
- Paste your JSON into the left panel, or click Load Sample to use the bookstore example
- Enter a JSONPath expression in the expression input field at the top
- The evaluator runs in real time — results appear immediately in the right panel
- Each match shows its full path (e.g.,
$.store.book[0].author) and value - Click Copy on individual matches, or Copy All to copy all matches as a JSON array
Expressions evaluate after a brief pause as you type, so you can see results as you build the expression.
JSONPath vs. JMESPath vs. XPath
JSONPath is one of several query languages for structured data:
| Language | Data format | Wildcard | Filter | Recursive | Standard |
|---|---|---|---|---|---|
| JSONPath | JSON | [*] | [?()] | .. | Goessner 2007 / RFC 9535 |
| JMESPath | JSON | [*] | [? ] | No | AWS-backed |
| XPath | XML | // | [@] | // | W3C |
| jq | JSON | .[] | select() | .. | CLI tool |
JSONPath is the most widely used for API testing and configuration, while JMESPath is preferred in AWS tooling. This tool implements the Goessner semantics compatible with most API testing frameworks.
Practical Use Cases
API Response Testing
After calling a REST API, use JSONPath to assert specific values:
$.data.users[?(@.role == "admin")].email
This extracts the email of every admin user from a paginated response — perfect for automated test assertions.
AWS CloudFormation
Reference outputs from other stacks using JSONPath-style queries in CloudFormation templates:
$.Outputs.BucketName.Value
Filtering Log Data
If logs are stored as JSON Lines, use JSONPath to find error entries:
$[?(@.level == "error")].message
Data Transformation
Extract specific fields when transforming JSON between formats:
$.items[*].id → all item IDs
$.items[*].price → all item prices
Common Questions
Is my data sent to a server? No. All JSONPath evaluation runs entirely in your browser using JavaScript. Your JSON data never leaves your device.
What JSONPath spec does this tool follow? This tool implements the Goessner JSONPath semantics (the original 2007 proposal), which is compatible with most API testing frameworks including Postman, REST-assured, and JsonPath for Java. RFC 9535 (the IETF standard) is a superset with some differences in edge cases.
Why does $..price return more results than $.store..price?
$..price searches the entire document from the root, including all nested objects. $.store..price restricts the search to start from the store key.
What is the difference between $.store.book[0].title and $.store.book[0]['title']?
They are identical — dot notation and bracket notation access the same property. Bracket notation is required when the key contains hyphens, spaces, or starts with a digit.
What does [?(@.isbn)] mean?
It is a filter expression meaning “elements that have an isbn property.” The @ refers to the current element in the iteration. @.isbn is truthy (non-null, non-undefined) only for elements that have that key.
Can I use regex in filter expressions?
Yes. Use the =~ operator: [?(@.email =~ /@example\.com$/)] matches all nodes where the email field ends in @example.com. The right side is a JavaScript regular expression.