JSON Path Query

Extract data from JSON using JSONPath expressions

JSON Input

Query Results

Paste your JSON on the left and the result shows up here.

Or drop a file on this box, , or .

What is JSON Path Query?

Need to extract specific data from huge JSON files? JSON Path lets you query and extract values from complex JSON (JavaScript Object Notation) structures. Think of it like XPath for XML, but for JSON.

JSONPath is to JSON what XPath is to XML: a short expression that points at the values you want. This tool supports the classic JSONPath syntax in the dialect the jsonpath-plus library implements, so you can pick fields, filter arrays and walk nested structures. Results come back as a JSON array, and big integers like 19-digit IDs keep every digit. Great for pulling a handful of values out of a big API response.

Everything happens in your browser, so your JSON never leaves your computer. The results update as you edit the expression or the JSON.

How to Use JSON Path Query

Follow these steps to extract data from JSON using JSONPath. Each step uses the actual inputs and panels on this page.

1

Paste JSON or Load Sample

Paste your JSON into the left JSON Input panel. Upload reads a .json or .txt file and pretty-prints it before the first query runs. Sample drops in the bookstore document from the original JSONPath article (two books and a red bicycle) with $.store.book[*].author already typed into the expression field.

2

Enter JSONPath Expression

Type your expression in the JSONPath Expression field below the editors. Examples: $..* (all values), $.store.book[*].author (all authors), $..price (all prices). Use the example buttons – All values, All authors, All prices, Books under $10 – to try common patterns. Results update automatically as you type.

3

View and Export Results

Matches land in the right Query Results panel as one JSON array, so the sample path gives ["Nigel Rees", "Evelyn Waugh"] and $..price gives [8.95, 12.99, 19.95]. Copy puts that array on the clipboard; Download saves it as jsonpath-results.json.

When You'd Actually Use This

Data Extraction

Extract specific values from large JSON documents. Find all prices, names, or IDs without manually navigating the structure.

Filtering Arrays

Use filter expressions to find items matching conditions. Find all products under a certain price, or users in a specific city.

API Testing

Test API responses by extracting specific fields. Verify that expected values exist and match your requirements.

Data Analysis

Extract data for analysis or reporting. Pull specific fields from JSON exports to use in spreadsheets or other tools.

Common Questions

Is my JSON data stored?

No. The expression is evaluated inside this tab, and the page has no Share or save button, so the document you paste is never sent to a server.

What JSONPath syntax is supported?

We support standard JSONPath syntax including: $ (root), . (child operator), .. (recursive descent), [*] (wildcard), [0] (array index), and [?(@.key)] (filter expressions). JSONPath only got a formal standard in 2024, as RFC 9535. This page follows the older Goessner-style syntax that jsonpath-plus implements, so a filter copied from an RFC 9535 engine may need small changes before it works here.

How do filter expressions work?

Filter expressions use [?(@.property operator value)] syntax. For example, $..book[?(@.price < 10)] finds all books with price less than 10.

Can I query nested objects?

Yep. Use the recursive descent operator .. to search through all levels. For example, $..price finds all price values no matter how deep they're nested.

What if the JSONPath doesn't match anything?

You get an empty array, []. Check the path against the actual key names (they're case-sensitive) and whether a level is an array that needs [*] or an index. If you're unsure of the names, open the document in the JSON table viewer first: each key shows up there as a column header, spelled exactly as it is in the data.

Does it work with invalid JSON?

No. A path needs a parsed tree to walk, so a trailing comma or a single-quoted key replaces the results with a line starting Error: followed by the browser's own complaint, which names the character position where parsing stopped. The JSON Validator turns that position into a line number, and the JSON Fixer repairs the usual slips.

Other JSON Tools You Might Need

Once a path has pulled out the values you care about, the next job is usually pretty-printing them, diffing two API responses, or turning the matched array into rows. These pages pick up from there: