JSON Path Queries Explained: Extract & Filter Data Like a Pro
2026-04-25 6 min read
JSONPath is a query language for JSON, similar to XPath for XML. It lets you write concise expressions to extract nested values without writing loops. Our JSONPath tool lets you test queries against your JSON interactively.
JSONPath Syntax
| Expression | Meaning |
|---|---|
| $ | Root object |
| $.foo | Property "foo" of the root |
| $.foo.bar | Nested property (dot notation) |
| $["foo"] | Property "foo" (bracket notation) |
| $.items[0] | First element of "items" array |
| $.items[*] | All elements of "items" array |
| $..name | All "name" properties at any depth (recursive) |
| $.items[?(@.status == "active")] | Filter: items where status equals "active" |
Real-World Examples
Sample data
{
"store": {
"books": [
{"title": "Book 1", "price": 10, "available": true},
{"title": "Book 2", "price": 15, "available": false},
{"title": "Book 3", "price": 12, "available": true}
]
}
} $.store.books[*].title→ All book titles$.store.books[0]→ First book (all fields)$..price→ All prices (anywhere in the JSON)$.store.books[?(@.available == true)].title→ Titles of available books
Test JSONPath queries
Paste your JSON and test query expressions interactively.