JSON Path Tester

Query JSON with dot notation and bracket syntax. Navigate nested objects and filter arrays in real time.

Dot notation Array filters Real-time Free
$ .
JSON input
Result
Advertisement
Path syntax reference
$.users
Access root property "users"
$.users[0]
First element of array
$.users[*].name
All names in users array
$.users[-1]
Last element of array
$.users[0:2]
Slice — elements 0 and 1
$.users[?active]
Filter — truthy "active" field
$.users[?age>25]
Filter — age greater than 25
$.store..price
Deep wildcard — all prices

JSONPath — Querying Nested JSON Like a Pro

JSONPath is to JSON what XPath is to XML and what SQL is to databases — a query language for extracting specific values from a document. Instead of writing nested loops to dig through a complex API response, a single JSONPath expression like $.users[?age>25].email extracts all email addresses of users older than 25 in one step.

The JSONPath syntax

$ represents the root of the document. A dot (.) accesses properties: $.user.name gets the name from the user object. Square brackets access array elements: $.users[0] gets the first user. The wildcard [*] selects all elements: $.users[*].name returns all user names as an array. The recursive descent operator .. searches at all depths: $..price finds every price value anywhere in the document.

Filter expressions

The filter operator [?condition] selects array items matching a condition. $.products[?price<10] returns products under $10. $.users[?active] returns users where active is truthy. Supported operators include ==, !=, >, <, >=, and <=. Filters make JSONPath especially powerful for processing API responses without writing JavaScript array methods.

Where JSONPath is used

AWS Step Functions use JSONPath to extract and transform data between workflow steps. Kubernetes admission webhooks use JSONPath for field extraction. API testing tools like Postman use JSONPath for response assertions. Grafana dashboards use JSONPath to extract metrics from JSON APIs. Understanding JSONPath is increasingly useful in modern infrastructure and API work.

Frequently asked questions

What is JSONPath?
JSONPath is a query language for JSON, similar to XPath for XML. It lets you navigate and extract specific values from nested JSON structures using a path expression. It's used in tools like jq, AWS Step Functions, Kubernetes, and many API testing tools.
What is the $ symbol in JSONPath?
$ represents the root element of the JSON document. All path expressions start from $. The dot (.) after $ accesses properties: $.name accesses the "name" property at the root level.
How do I access nested properties?
Use dot notation: $.user.address.city. Or bracket notation: $.user["address"]["city"]. Both work identically. Use bracket notation for keys that contain spaces or special characters.
How do array filters work?
Use [?condition] syntax. $.users[?age>18] returns all users where age is greater than 18. Supported operators: ==, !=, >, <, >=, <=. Use just a key name for truthy check: [?active].
What does [*] mean?
[*] is a wildcard that matches all elements of an array. $.users[*].name returns the name property from every user in the array as a new array.
What is the .. (deep wildcard) operator?
The recursive descent operator .. searches at all levels. $..price returns every "price" property found anywhere in the JSON, regardless of nesting depth.