JSONPath Evaluator
JSONPath is a query language for JSON data, similar to XPath for XML. Use $ for root, .key for child properties, [n] for array indexes, [*] for all items, and ..key for recursive descent. Example: $.store.book[0].title gets the first book title. $.store.book[*].author gets all authors. JSONPath expressions let you extract specific values from complex nested JSON without writing code.
Evaluate JSONPath expressions against JSON data. Query nested objects, filter arrays, and extract values using dot notation, wildcards, and array indexing. Paste your JSON, write a path, see results instantly.
Presets
JSONPath Expression
JSON Input
JSONPath Expression Reference
| Expression | Description | Example |
|---|---|---|
| $ | Root object | $ |
| .key | Child property | $.user.name |
| [n] | Array index (0-based) | $.items[0] |
| [*] | All array elements | $.items[*].name |
| .* | All child properties | $.config.* |
| .a.b.c | Nested path | $.a.b.c |
How to Use
- 1
Paste your JSON
Paste the JSON data you want to query. Or click a preset to load sample data like a user object, product array, or config file.
- 2
Enter a JSONPath expression
Type a JSONPath expression like $.store.book[0].title or $.users[*].name. Use $ for root, .key for properties, [n] for indexes, [*] for all items.
- 3
View matched results
Matching values appear instantly as you type. See the match count and formatted output. Invalid expressions show an error message.
- 4
Copy the results
Click Copy to copy the matched values. Use them in your code, API tests, or data analysis workflows.
Frequently Asked Questions
- What is JSONPath?
- JSONPath is a query language for JSON data, similar to XPath for XML. It lets you navigate and extract values from complex JSON structures using dot notation ($.store.books), array indexing ($.items[0]), and wildcards ($.users[*].name). The root of the document is represented by $.
- How do I select all items in an array?
- Use the wildcard [*] after the array key. For example, $.products[*].name selects the name field from every object in the products array. You can also use $.products[*] to get all objects without filtering a specific field.
- What is the difference between JSONPath and jq?
- JSONPath uses dot notation starting from $ (e.g., $.store.books[0].title) and is commonly used in REST API testing tools like Postman. jq uses pipe-based syntax (e.g., .store.books[0].title) and is a command-line tool with more powerful filtering, mapping, and transformation capabilities. JSONPath is simpler for basic queries.
- Can JSONPath filter array elements by value?
- Standard JSONPath supports filter expressions like $..book[?(@.price<10)] to select books with price less than 10. This evaluator supports the core JSONPath syntax — dot notation, array indexing, and wildcards — which covers the most common use cases for querying JSON data.
- Why would I use JSONPath instead of JavaScript?
- JSONPath provides a concise, declarative way to describe which data you want without writing procedural code. It is useful in configuration files, API testing tools, monitoring dashboards, and template engines where you need to reference JSON fields by path string rather than writing code.
- Does JSONPath work with nested objects?
- Yes. JSONPath excels at navigating deeply nested structures. For example, $.company.departments[*].employees[*].name traverses through a company object, iterates all departments, then all employees in each department, and extracts their names — all in one expression.