FC

📍 JSONPath Tester

Runs entirely in your browser - no data sent to server

Output appears here...
Complete Guide

📊 Key Data Points

$ is root

All JSONPath expressions must start with $ (the root element)

$..field

Recursive descent — finds a field at any depth without knowing the full path

?(@.x)

Filter expressions use @ for the current element in array context

JSONPath Tester — Query JSON with JSONPath Expressions -- Complete USA Guide 2026

JSONPath is to JSON what XPath is to XML — a query language for extracting specific values from nested JSON structures without writing traversal code. A single `$.store.book[*].author` expression returns all book authors at any depth.

This tester evaluates JSONPath expressions against your JSON in real time. Runs in your browser.

**Long-tail searches answered here:** test JSONPath expression online free, how to query nested JSON array with JSONPath, JSONPath filter expressions browser tool.

Validate your JSON first with JSON Formatter.

🔬 How This Calculator Works

Uses a JSONPath engine running in the browser. Expressions start with $ (root). Dot (.) accesses children; [] handles array subscripts and filters; * is wildcard; .. is recursive descent (finds a field at any nesting depth). Filter expressions $[?(@.price < 10)] use @ to reference the current element. Results are highlighted in the JSON display.

✅ What You Can Calculate

Real-time match highlighting

Matching nodes highlight in the JSON view as you type. Instant visual feedback for validating that your expression targets the right data.

Recursive descent

$..field finds all occurrences at any depth without knowing the exact path. Essential for querying inconsistently structured API responses.

Filter expression support

$[?(@.status==active && @.age>18)] filters arrays by property values. More powerful than writing filter loops in application code.

Multiple results display

Shows all matching nodes with their full paths when the expression matches multiple elements — useful for understanding what a wildcard expression actually returns.

🎯 Real Scenarios & Use Cases

Extracting API response fields

Your API returns deeply nested data. Use $..id to extract all IDs at any depth, or $.data.users[*].email to get all emails from a paginated response.

Filtering array responses

API returns a product list. Use $[?(@.inStock==true && @.price<50)] to filter without writing application-layer filter code.

Pre-code testing

Validate your JSONPath expression here before writing it into Python (jsonpath-ng), JavaScript (jsonpath-plus), or Java (Jayway) code.

CSV pipeline

Convert CSV with CSV to JSON, then use JSONPath to extract specific columns or rows here.

💡 Pro Tips for Accurate Results

Start broad with $..field, then narrow. Use recursive descent to find where a field appears in the structure, then narrow to the full explicit path once you know the nesting level.

Arrays are 0-indexed. $[0] is first, $[-1] is last (most implementations). $[0:3] is a slice returning elements 0, 1, 2.

Inside filters, use @ not $. $[?(@.active==true)] — @ is the current element being tested. $ inside a filter references the root, not the current element.

Validate JSON first. Paste your JSON into JSON Formatter before testing — invalid JSON silently returns no results in most JSONPath engines.

🔗 Use These Together

🏁 Bottom Line

JSONPath transforms nested JSON traversal from multi-line application code into a single reusable expression. Test expressions against real data here before committing them to code. Pair with JSON Formatter for validation and JSON Schema Generator for documentation.

What is JSONPath and how is it used?

JSONPath is a query language for JSON, analogous to XPath for XML. It lets you extract specific values from a JSON document using a path expression. $.store.book[0].title extracts the title of the first book. $.store.book[*].author extracts all authors. $..price extracts all price values recursively. JSONPath is used in: API testing tools (Postman, Insomnia assertions), AWS Step Functions and EventBridge rule patterns, Kubernetes JSON patch operations, log processing pipelines (Logstash, jq), and backend code that processes API responses.

What is the difference between dot notation and bracket notation in JSONPath?

Both access object properties: $.store.book is identical to $['store']['book']. Bracket notation is required when property names contain spaces, special characters, or start with digits: $['property name with spaces']['0invalid-start']. Bracket notation also supports expressions: $[(@.length-1)] accesses the last element. Dot notation is cleaner and more readable for simple paths. The root $ must always be present. .. is recursive descent (searches all levels). * is wildcard (matches any property or array element). [start:end] is array slice notation.

How do I filter array elements by a property value in JSONPath?

Use filter expressions with the ? operator: $.store.book[?(@.price < 10)] returns books where price is less than 10. @.price refers to the current node's price property. Common filter operators: == (equals), != (not equals), < (less than), > (greater than), <= (at most), >= (at least). String matching: $.users[?(@.role == 'admin')] returns admin users. Multiple conditions: [?(@.price < 10 && @.category == 'fiction')]. Filter expressions are the most powerful JSONPath feature for querying arrays of objects.

How does $.. (recursive descent) differ from $ (root)?

$ refers to the root of the document. $.. searches recursively through all levels. If your JSON has nested objects at unknown depth and you want all price values regardless of nesting level: $..price matches every price field anywhere in the document tree. This is powerful for querying deeply nested structures without knowing the exact path. Potential issue: recursive descent can match more than expected if the property name appears at multiple levels with different meanings. Use specific paths when structure is known; use $.. when structure varies.

What is the difference between JSONPath and JMESPath?

Both query JSON but are different specifications. JSONPath is older and more widely referenced in documentation. JMESPath is used by the AWS CLI (aws --query flag) and has a more formal grammar. Differences: JMESPath uses pipes (|) for function application; JSONPath uses filter expressions. JMESPath has built-in functions (length, sort, min_by, max_by); JSONPath functions vary by implementation. JMESPath is stricter — invalid expressions fail clearly; JSONPath behavior on edge cases varies between implementations. If you are using the AWS CLI, learn JMESPath. For general JSON querying, JSONPath is more universally recognized.

How do I use JSONPath in JavaScript?

No built-in JSONPath support exists in JavaScript. Use the jsonpath npm package: const jp = require('jsonpath'); jp.query(data, '$.store.book[*].author'). Or jsonpath-plus: import { JSONPath } from 'jsonpath-plus'; JSONPath({ path: '$.store.book[*]', json: data }). For Node.js scripts processing large JSON: jq (command-line tool) is faster than JavaScript solutions for large data processing. Many API testing frameworks include JSONPath support — Postman uses pm.response.json() with standard JavaScript property access rather than JSONPath expressions.

What other JSON tools are on this site?

The JSON Formatter validates and beautifies JSON before querying with JSONPath. The JSON Schema Generator creates a validation schema from your JSON structure. The JSON to CSV tool flattens arrays found via JSONPath to tabular format. The Diff Checker compares JSONPath query results from two versions of a document. The curl Builder generates the API calls that produce the JSON you are querying. All are in the Dev Tools section.