How to Query JSON with JSONPath

Extract data from JSON using JSONPath expressions. Free online evaluator with syntax highlighting, path suggestions, and result preview for complex nested JSON.

Open JSONPath Evaluator →

Step-by-Step Guide

1

Paste your JSON data

Paste your JSON document into the input editor. The tool validates and formats it automatically with syntax highlighting, making it easy to understand the structure. You can work with any valid JSON — simple objects, deeply nested structures, or large arrays with thousands of elements.

2

Write a JSONPath expression

Enter your JSONPath query in the expression field. Start with $ to reference the root element, use .property to access object keys, and [*] to select all items in an array. For example, $.store.book[*].author selects every author from every book in the store. The syntax is intuitive if you are familiar with dot notation in JavaScript.

3

Preview the matched results

The tool evaluates your expression in real time and displays the matching nodes in the result panel. You can see exactly which parts of the JSON were selected, making it easy to iterate on your query. If no results appear, check your path for typos or use $..[key] for recursive descent to search all levels.

4

Use advanced features for complex queries

Apply filter expressions like $..book[?(@.price<10)] to select books under $10, or use [0,1] to pick specific array indices. Recursive descent with .. searches through all nested levels — useful when you do not know the exact depth. Combine these features to extract precisely the data you need from any JSON structure.

Try It Now — Free

No signup, no download. Runs entirely in your browser.

Open JSONPath Evaluator

Frequently Asked Questions

What is the difference between JSONPath and jq?
JSONPath is a query language designed for selecting nodes in JSON documents, similar to XPath for XML. jq is a command-line JSON processor that can transform, filter, and restructure JSON. JSONPath is simpler and works well for extraction, while jq is more powerful for complex transformations and is typically used in shell scripts and CI pipelines.
What are the most common JSONPath expressions?
The most used expressions are: $ (root object), $.property (direct child), $..property (recursive descent — find property at any depth), $[*] (all array elements), $[0] (first element), and $[?(@.key==value)] (filter by condition). These cover the vast majority of real-world JSON querying needs.
How do I access nested arrays in JSONPath?
Chain array accessors along the path — for example, $.data[0].items[*].name selects the name from every item in the first data entry. Use [*] to iterate all elements at a level, or specific indices like [0] or [2] for particular positions. For deeply nested or unknown structures, use recursive descent like $..items[*].name to match at any depth.
Related Reference

JSON Cheat Sheet

View Cheat Sheet →

More Guides