Related JSON Tools
JSON Minifier
JSON Beautifier
JSON Converter
JSON Schema Validator
JSON Path Finder
Extract and query JSON data using JSONPath expressions. Navigate complex structures and filter data with powerful path-based queries.
JSONPath Expression
Common JSONPath Examples:
JSON Data
Query Results
Execute a JSONPath query to see results here
π JSONPath Syntax Reference
Basic Syntax
$Root element.propertyChild property[index]Array index[*]All array elements..Recursive descentAdvanced Features
[start:end]Array slice[?(@.prop)]Filter expression.*All properties@Current item (in filters)What is JSONPath?
JSONPath is a query language for JSON, similar to XPath for XML. It allows you to extract specific data from JSON documents using path expressions. JSONPath provides a simple way to navigate and filter complex JSON structures.
With JSONPath, you can access nested objects, filter arrays based on conditions, and extract multiple values that match specific patterns, making it an essential tool for data processing and API integration.
Key Features
Path Expressions
Use dot notation and bracket syntax for navigation
Array Filtering
Filter arrays with conditional expressions
Wildcard Support
Use wildcards to match multiple elements
Multiple Results
Extract multiple matching values at once
Deep Navigation
Navigate deeply nested JSON structures
Real-time Results
See results update as you type
JSONPath Syntax Guide
Basic Operators
$Root element.Child operator..Recursive descent*Wildcard[]Array index/sliceExample Expressions
$.store.book[0].titleFirst book title
$.store.book[*].authorAll book authors
$..priceAll prices in document
$.store.book[?(@.price < 10)]Books under $10
Common Use Cases
API Data Processing
- β’ Extract specific fields from API responses
- β’ Filter data based on conditions
- β’ Transform nested data structures
Configuration Management
- β’ Extract configuration values
- β’ Validate configuration structure
- β’ Update specific settings
Data Analysis
- β’ Analyze large JSON datasets
- β’ Extract metrics and statistics
- β’ Filter and aggregate data
Testing & Validation
- β’ Verify API response structure
- β’ Extract test data
- β’ Validate data integrity
JSONPath Examples
Example 1: E-commerce Data
Sample 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
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}JSONPath Queries:
$.store.book[*].titleResult: All book titles
$..priceResult: [8.95, 12.99, 19.95]
$.store.book[?(@.price < 10)]Result: Books under $10
Example 2: User Data
Sample JSON:
{
"users": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"active": true,
"roles": ["user", "admin"]
},
{
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com",
"active": false,
"roles": ["user"]
}
]
}JSONPath Queries:
$.users[?(@.active)].nameResult: Active user names
$.users[*].roles[*]Result: All user roles
$.users[0].emailResult: First user's email
Frequently Asked Questions
What is the difference between JSONPath and XPath?
JSONPath is designed specifically for JSON data, while XPath is for XML. JSONPath uses simpler syntax with dot notation and bracket expressions, making it more intuitive for JSON navigation.
How do I filter arrays with conditions?
Use the filter expression syntax: $[?(@.property operator value)]. For example,$.users[?(@.age > 18)] finds all users older than 18.
Can I use JSONPath with nested arrays?
Yes, JSONPath handles nested arrays well. Use multiple bracket notations like $.data[0].items[*]or recursive descent $..items[*] to access deeply nested array elements.
What operators are supported in filter expressions?
Common operators include: == (equals), != (not equals), < (less than),> (greater than), <= (less than or equal), >= (greater than or equal).
How do I extract all values of a specific property?
Use the recursive descent operator: $..propertyName will find all occurrences of "propertyName" throughout the entire JSON document, regardless of nesting level.
Is my JSON data secure when using this tool?
Yes, all JSONPath processing is performed locally in your browser. Your JSON data is never sent to our servers, ensuring complete privacy and security of your information.