JSONPath Evaluator — Test JSONPath Expressions Online

Test JSONPath expressions against your JSON data in real time. Supports filters, wildcards, recursive descent, and array slicing.

Your data never leaves your browser
Examples:
Results will appear here...

How to Use

  1. Paste your JSON data into the left input panel (sample data is provided to get started).
  2. Type a JSONPath expression in the query bar at the top, e.g. $.store.books[*].title.
  3. Results appear instantly in the right panel as you type — no submit button needed.
  4. Click any example chip to try pre-built expressions on the sample data.
  5. Toggle the Cheat Sheet button for a quick syntax reference.
  6. Click Copy Results to copy matched values to your clipboard.

What Is JSONPath?

JSONPath is a query language for extracting data from JSON documents, originally proposed by Stefan Gössner in 2007. It fills the same role for JSON that XPath fills for XML: given a complex, deeply nested data structure, JSONPath lets you pinpoint exactly the values you need with a single expression.

JSONPath is widely supported across programming languages and tools. Libraries exist for JavaScript, Python (jsonpath-ng), Java (com.jayway.jsonpath), Go, Ruby, and more. The syntax is standardized in RFC 9535, published in February 2024, which formalized the language after years of informal adoption.

Common use cases include extracting fields from API responses, writing assertions in API testing tools like Postman, configuring data pipelines, and querying configuration files. If you’ve ever written response.data.users[0].name in JavaScript, you already understand the intuition behind JSONPath.

JSONPath Syntax Reference

Every JSONPath expression starts with $, which represents the root of the JSON document. From there, you chain operators to navigate the structure:

Basic Navigation

$                  # The root object
$.name             # Dot notation: access "name" property
$["name"]          # Bracket notation: same as above
$.users[0]         # Array index: first element (0-based)
$.users[-1]        # Negative index: last element
$.store.books[*]   # Wildcard: all elements in array
$.config.*         # Wildcard: all values in object

Array Slicing

$.items[0:3]       # Elements at index 0, 1, 2 (end exclusive)
$.items[2:]        # From index 2 to the end
$.items[:4]        # First 4 elements
$.items[0:6:2]     # Every 2nd element from 0 to 5
$.items[-3:]       # Last 3 elements

Recursive Descent

$..name            # Find all "name" properties at any depth
$..price           # Find all "price" values anywhere in the tree
$..[0]             # First element of every array in the document

Filter Expressions

$.books[?(@.price < 20)]          # Books cheaper than $20
$.books[?(@.author == "Fowler")]  # Books by specific author
$.users[?(@.active)]              # Users where "active" is truthy
$.items[?(@.stock != 0)]          # Items that are in stock
$.books[?(@.price >= 40)]        # Books $40 or more

JSONPath vs jq

JSONPath and jq solve overlapping but distinct problems. JSONPath is a query language — it selects and extracts values from JSON. jq is a transformation language — it can filter, reshape, compute, and construct entirely new JSON structures. Here’s a practical comparison:

TaskJSONPathjq
Get all book titles$.store.books[*].title.store.books[].title
Filter by price$.store.books[?(@.price < 40)][.store.books[] | select(.price < 40)]
Sum all pricesNot possible[.store.books[].price] | add
Reshape outputNot possible.store.books[] | {title, price}
Deep scan for field$..author[.. | .author? // empty]

Use JSONPath when you need simple extraction — API testing, config lookups, or selecting specific fields. Use jq when you need to transform, aggregate, or restructure the data. Try our jq Playground for transformation tasks.

Common Use Cases

API Response Extraction

When working with REST APIs, responses are often deeply nested. JSONPath lets you reach into the structure without writing loops. For example, given a GitHub API response, $[*].full_name extracts all repository names, and $[?(@.stargazers_count > 1000)].html_url finds URLs of popular repositories.

API Testing with Postman

Postman and similar tools use JSONPath for response assertions. You can write test scripts like pm.expect(jsonData.$.users[0].role).to.equal("admin") to validate that API responses contain the expected data at specific paths.

Configuration Queries

Large configuration files (Kubernetes manifests, Terraform state, package.json dependency trees) become manageable with JSONPath. Kubernetes kubectl supports JSONPath natively: kubectl get pods -o jsonpath='{.items[*].metadata.name}' lists all pod names.

Data Pipeline Filtering

ETL pipelines and data processing workflows use JSONPath to extract relevant fields from incoming JSON payloads before routing them to downstream systems. Tools like Apache Camel and AWS Step Functions support JSONPath expressions for data selection.

JSONPath in Different Languages

# Python (jsonpath-ng)
from jsonpath_ng import parse
expr = parse("$.store.books[*].title")
matches = [m.value for m in expr.find(data)]

# JavaScript (jsonpath-plus)
import { JSONPath } from "jsonpath-plus";
const titles = JSONPath({ path: "$.store.books[*].title", json: data });

# Java (Jayway JsonPath)
List<String> titles = JsonPath.read(json, "$.store.books[*].title");

# kubectl
kubectl get pods -o jsonpath='{.items[*].metadata.name}'

Related Tools

For more powerful JSON transformations, try the jq Playground. Format raw JSON with the JSON Formatter. Validate JSON syntax with the JSON Validator. Convert JSON to CSV with the JSON to CSV Converter. Validate JSON against a schema with the JSON Schema Validator.

Frequently Asked Questions

What is JSONPath?
JSONPath is a query language for JSON data, similar to how XPath works for XML. It lets you extract specific values from complex JSON structures using concise path expressions. For example, $.store.books[*].title extracts all book titles from a nested JSON object.
Does this tool send my data to a server?
No. All JSONPath evaluation happens entirely in your browser using a pure JavaScript implementation. Your JSON data never leaves your machine — there are no network requests involved in processing.
What is the difference between JSONPath and jq?
JSONPath is a query/extraction language — you write path expressions to select values from JSON. jq is a full transformation language that can filter, reshape, compute, and construct new JSON. Use JSONPath when you need to extract specific fields; use jq when you need to transform or aggregate data. Try our jq Playground for more complex transformations.
What does the $ symbol mean in JSONPath?
The $ symbol represents the root element of your JSON document. Every JSONPath expression starts with $. For example, $.name accesses the "name" property at the root level, and $.users[0] accesses the first element of the root-level "users" array.
How do I filter array elements in JSONPath?
Use filter expressions with the [?()] syntax. The @ symbol refers to the current element being evaluated. For example, $.books[?(@.price < 20)] selects books with price less than 20, and $.users[?(@.active)] selects users where the "active" property is truthy.
What does the .. (recursive descent) operator do?
The double-dot (..) operator performs a deep scan of the entire JSON structure. For example, $..name finds every "name" property at any depth in the document, regardless of nesting. This is useful when you know the field name but not where it appears in the structure.

AI agent tools available. The CodeTidy MCP Server gives Claude, Cursor, and other AI agents access to 47 developer tools. One command: npx @codetidy/mcp

Drop file to load