JSON Input

Query Results

Examples:

What Is JSON Path?

JSONPath is a query language for JSON, similar to XPath for XML. You write an expression like $.planCatalog.plans[*].carrierName to extract specific values from nested structures. It's useful when you have a large JSON response and only need certain fields, or when you're building scripts that process JSON.

This tool lets you paste JSON, enter a JSONPath expression, and see the matching values. The query runs in your browser. Nothing is sent to a server.

How to Use This Tool

1

Paste Your JSON

Paste JSON into the left editor or upload a file. Use Sample to load example data. The sample includes a structure you can query (e.g. planCatalog, plans, carriers).

2

Enter JSONPath Expression

Type your expression in the input field, e.g. $.planCatalog.plans[*].carrierName for all carriers. Use the example buttons for common patterns. The JSONPath syntax uses $ for the root, . for child access, and [*] for array wildcards.

3

View Results

The right panel shows the matched values. Use Copy or Download to get them. For command-line use, jq is a popular alternative.

JSON Path Examples

Extract specific values from nested JSON. Telecom-themed example:

JSON input

Input

JSONPath expression

$.subscribers[*].planName

Result: ["Premium 4G", "Basic"]

Where JSON Path Helps

Most developers need JSONPath when working with large API responses. You get a nested JSON blob from Postman or fetch, and you only need a few fields—e.g. all author values from a list of books. Writing a JSONPath expression is faster than manually traversing the structure. For database exports, log analysis, or webhook payloads, JSONPath lets you extract specific values without parsing the whole document.

It's also useful before converting JSON to other formats. Extract the data you need with JSONPath, then use JSON to CSV or JSON to XML on the result. For command-line automation, jq offers similar capabilities with a different syntax.

JSONPath Basics

$ is the root. $.key gets a property. $.array[0] gets the first element. $.array[*] gets all elements. $.items[*].name gets the name property from each object in items. Filter expressions like $.book[?(@.price < 10)] select items that match a condition. The exact syntax can vary; this tool follows the original JSONPath proposal.

For more complex queries or scripting, jq has a different but powerful syntax. For converting JSON to other formats after extracting data, try JSON to CSV or JSON to XML.

Frequently Asked Questions

Is my data sent anywhere?

No. The query runs in your browser.

What if the expression returns nothing?

Check the path. Keys are case-sensitive. Array indices are 0-based. Use [*] for "all elements" in an array. Validate your JSON with the JSON Validator first.

Does this support JSONPath filters?

Support depends on the library. Filters like [?(@.price > 10)] may or may not work. Check the tool's documentation or try the example buttons.

Can I use this for API responses?

Yes. Paste the response from Postman or your app, then query the fields you need. Format the JSON first with the JSON Formatter if it's minified.

How is this different from jq?

jq is a command-line tool with its own syntax. JSONPath is a different standard. This tool uses JSONPath for browser-based queries. For automation, jq is often better.

Related Tools

The JSONPath specification is at goessner.net. For JSON, see json.org, RFC 8259, and MDN JSON. For command-line JSON processing, see jq. For XPath (the XML equivalent), see MDN XPath.