JSONPath Tester
Test JSONPath expressions against your JSON data. See matching results instantly as you type.
Enter a JSONPath expression to see matching results
JSONPath Tips & Tricks
Master JSONPath expressions to extract exactly the data you need.
Start with $ — The Root Element
Every JSONPath expression starts with $ which represents the root of the JSON document. Use $.key to access a top-level key, and chain with dots or brackets for nested access: $.store.book[0].title
Use Recursive Descent (..) to Find Keys Anywhere
The .. operator searches all levels of nesting. For example, $..price finds every 'price' field in the document, regardless of depth. This is powerful for exploring unfamiliar JSON structures.
Filter Arrays with [?()]
Use filter expressions to query arrays by conditions. For example, $.books[?(@.price < 10)] returns all books cheaper than 10. The @ symbol refers to the current element being evaluated.
Common JSONPath Patterns
$..* returns all values. $.store.book[*].author returns all authors. $.store.book[-1:] returns the last book. $.store.book[0,1] returns the first two books. Memorize these patterns for daily use.
JSONPath Features
Test and debug JSONPath queries with ease.
Live Expression Testing
Type your JSONPath expression and see matching results update in real-time.
Full JSONPath Support
Supports standard JSONPath syntax including wildcards, recursive descent, filters, and array slicing.
Result Highlighting
Matching nodes are highlighted so you can verify your expression targets the right data.
What is JSONPath?
JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract specific values from a JSON document using path expressions. The root element is always referred to as $.
Quick Reference
| Expression | Description |
|---|---|
| $ | Root object |
| $.store | Child property |
| $.store.book[0] | Array element by index |
| $.store.book[*] | All array elements |
| $..author | Recursive search (all "author" fields) |
| $.store.book[*].title | All titles in book array |
Example
Given this JSON:
{
"users": [
{ "name": "Alice", "age": 30 },
{ "name": "Bob", "age": 25 }
]
}The expression $.users[*].name returns: ["Alice", "Bob"]
JSONPath FAQ
What is JSONPath?
JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract specific data from JSON documents using path expressions like $.store.book[*].author.
What expressions are supported?
Standard JSONPath expressions including $ (root), . (child), .. (recursive), * (wildcard), [] (subscript), [?()] (filter), and more.
Can I use filters?
Yes, filter expressions are supported for querying elements based on conditions, such as filtering books by price or other properties.
What is the difference between dot notation and bracket notation?
Both access child properties: $.store.book and $['store']['book'] are equivalent. Use bracket notation when keys contain special characters, spaces, or start with numbers.
How is JSONPath different from jq?
JSONPath is a query language for extracting data from JSON, similar to XPath for XML. jq is a more powerful command-line JSON processor with filtering, transformation, and output formatting capabilities. JSONPath focuses purely on data selection.
Can I select values at multiple levels of nesting?
Yes, use the recursive descent operator (..) to search all levels. For example, $..name finds every 'name' field regardless of depth in the document hierarchy.
What are common JSONPath patterns I should know?
Key patterns: $..* (all values), $.items[*].name (all names in items), $.items[-1:] (last item), filter by condition with [?(expression)], and $.items[0:5] (first five items via array slice).
Related Tools
Explore more JSON tools to streamline your workflow.
How to Search JSON — Find Keys, Values & Nested Data
Search any JSON document instantly. Find keys, values and deeply nested data using JSONPath expressions, text search or tree navigation — all in your browser.
JSON Schema Validator
Validate JSON data against a JSON Schema. Get detailed error messages with exact paths for any violations.
JSON Formatter
Pretty print and beautify JSON with configurable indentation. Paste your JSON and format it instantly.
Large JSON Viewer
Explore large JSON files with a fast, collapsible tree viewer. Adjustable depth controls and timestamp detection built in.
JSON Validator
Validate JSON instantly with precise error messages. Get exact line and column numbers for any syntax errors.