Query JSON with JSONPath
online, free & instant
Write JSONPath expressions and see matching results instantly. Supports wildcards, recursive descent, array slicing, and conditional filters. Works entirely in your browser — no upload, no account.
Open JSONPath EvaluatorQuery any JSON structure in seconds
No install. No account. No nonsense.
100% Private
Your JSON never leaves your device. There is no server receiving your data.
Instant Results
Query results appear as you type. No round-trips to a backend, no latency.
Full JSONPath
Wildcards, recursive descent, slices, and filter expressions — the complete JSONPath spec.
Related JSON tools
Common questions answered
What is a JSON query language?
A JSON query language lets you extract, filter, and transform data from JSON documents using path expressions. Popular options include JSONPath (XPath for JSON), JMESPath (used by AWS CLI), and jq (command-line JSON processor). This tool uses JSONPath syntax — expressions like $.store.book[?(@.price<10)] to select matching nodes.
What is JSONPath and how does it work?
JSONPath is a query language for JSON, inspired by XPath for XML. It uses dot notation ($.store.book) and bracket notation ($['store']['book']) to traverse JSON structures. It supports wildcards (*), recursive descent (..), array slicing ([0:3]), and filter expressions (?(@.price<10)) to select specific nodes from a JSON document.
What is the difference between JSONPath, JMESPath, and jq?
JSONPath uses path expressions like $.store.book[*].author and is widely supported in testing tools and APIs. JMESPath uses a pipe-based syntax like store.book[*].author and is the default query language for AWS CLI. jq uses a Unix-filter style like .store.book[].author and is popular in shell scripting. All three achieve similar results with different syntax.
How do I filter JSON arrays by a condition?
Use JSONPath filter expressions. For example, $.products[?(@.price > 50)] selects all products with a price greater than 50. Supported operators include == (equals), != (not equals), < (less than), > (greater than), <= and >= comparisons.
Is my JSON data safe when using this query tool?
Yes, completely safe. All querying and filtering happens entirely in your browser using JavaScript. Your JSON is never uploaded or transmitted to any server. The tool even works offline after the first load.
What are JSON query languages?
JSON query languages provide structured ways to search, filter, and transform JSON data using declarative expressions. Unlike imperative code that loops through arrays, a query language lets you describe what you want and handles traversal automatically. Popular options include JSONPath, JMESPath, and jq — each with different syntax and capabilities.
This tool supports JSONPath for interactive querying. Type a query to extract nested values, filter arrays by conditions, or select specific fields. Query languages are particularly valuable when exploring unfamiliar JSON: instead of mentally parsing a 500-line response, you write a query to extract exactly the fields you need.
// Data
{"users":[
{"name":"Alice","role":"admin"},
{"name":"Bob","role":"user"},
{"name":"Charlie","role":"admin"}
]}
// Query: $.users[?(@.role=="admin")].name
["Alice", "Charlie"] // 2 matches found
Get the most out of this tool
- Start with $ (root) and add segments progressively — $.users, then $.users[0], then $.users[0].name — to explore data.
- Use filter expressions to find records matching criteria without writing loops or temporary variables.
- JSONPath is the most widely supported query language for JSON — learning it once applies across many tools and libraries.
Comparing JSON query languages — JSONPath, JMESPath, and jq
The JSON ecosystem has produced three primary query languages, each with different design goals and capabilities. JSONPath, inspired by XPath for XML, is the oldest and most widely embedded in tools and frameworks. JMESPath offers a formally specified, cross-platform consistent query language adopted as the standard by the AWS CLI and other cloud tools. jq is the most powerful — a full expression language for transformation and aggregation, not just querying. Understanding when to use each language is as important as understanding their syntax.
JSONPath (RFC 9535) uses $ as the root identifier and provides intuitive dot-notation ($.store.book[0].title) and bracket-notation access. Its .. recursive descent operator searches at any depth without specifying the exact path — $..price finds all price fields anywhere in the document. Filter expressions use ?(@.field == value) syntax. JSONPath is well-suited for path-based value extraction and is the query language of choice for tools like Postman, k6, AWS Step Functions, and JSON Schema's $ref resolution.
JMESPath (jmespath.org) was designed for strict specification compliance and consistent behavior across implementations. It lacks recursive descent but offers pipe operators for chaining: people[?active] | [0].name filters and then takes the first result's name. JMESPath's multi-select syntax creates new structures: people[*].{name: name, age: age} produces a new array of objects with only the specified fields. Its built-in functions — sort_by(), min_by(), max_by(), join() — enable common transformations without a full programming language.
jq's filter language is the most expressive but also the most complex to learn. It treats JSON as a stream of values and applies transformations to each value. The pipe operator | chains operations; the comma operator , produces multiple outputs; reduce accumulates results. jq programs can define functions, use variables ($x`), apply conditional logic (if-then-else), and handle errors with try-catch. For automation pipelines that require real data transformation rather than simple extraction, jq is the appropriate tool.
Choosing between query languages depends on the context. For embedded use in testing tools (Postman, Insomnia, REST Client for VS Code), JSONPath is the standard. For AWS CLI and cloud automation scripts, JMESPath is required. For terminal-based data processing and shell scripting, jq is the most powerful option. For browser-based query tools without jq installation, JSONPath implementations in JavaScript are the most mature and widely available.
SQL-like JSON query languages provide an alternative for developers familiar with relational databases. AlaSQL and Apache Calcite allow SQL-like queries over JSON arrays: SELECT name, age FROM ? WHERE age > 30 ORDER BY name. These approaches leverage existing SQL knowledge but lack the structural transformation capabilities of jq or the path navigation features of JSONPath. They are particularly useful for tabular JSON data (arrays of uniform objects) where SQL's GROUP BY and aggregate functions are the natural query operations.
The standardization of JSONPath as RFC 9535 (published in 2024) marks a significant milestone for the JSON ecosystem. Previously, JSONPath implementations differed in their handling of edge cases, filter expression syntax, and recursive descent behavior. RFC 9535 defines a normative specification that resolves these inconsistencies, enabling interoperable JSONPath implementations across languages. Tools and libraries that implement RFC 9535 can now be used interchangeably, reducing the "which JSONPath flavor" problem that plagued developers for over a decade.
Choosing the right JSON query language
$.data[0].id to verify response structure is the most common JSONPath use case — supported natively by virtually every API testing tool without additional configuration.
--query parameter. DevOps engineers writing infrastructure automation scripts use JMESPath to extract resource IDs, IP addresses, and status values from cloud API responses for use in subsequent script steps.
kubectl supports both JSONPath (-o jsonpath) and jq (via piping). Go template output (-o go-template) is another Kubernetes-specific option. Infrastructure engineers choose based on query complexity — JSONPath for simple field extraction, jq for multi-field formatting and conditional logic.
Choosing and using JSON query languages effectively
- Match the language to the tool ecosystem: Don't fight your tool's native query language. Use JMESPath for AWS CLI scripts, JSONPath for Postman tests, and jq for terminal data processing. Mixing query languages in the same codebase increases the learning burden for new team members.
- Start simple, add complexity gradually: Begin with a simple path expression and test it before adding filters or transformations. Build complex jq programs incrementally using the pipe operator, testing each intermediate step with a playground or the command line before combining into a single expression.
- Document non-obvious expressions: Complex JSONPath or jq expressions are difficult to understand without context. Add inline comments (in scripts) or documentation strings explaining what a query extracts and why it is structured a particular way. Future maintainers will thank you.
- Test against multiple response variants: Query expressions written against one API response example may fail for edge cases — empty arrays, missing optional fields, or different response shapes for error conditions. Test your expressions against multiple response samples including edge cases before relying on them in production scripts.
Additional frequently asked questions
Which JSON query language should I learn first?
JSONPath is the best starting point — it has intuitive syntax similar to file paths, is supported in most API testing tools and programming language libraries, and is now formally standardized as RFC 9535. Once comfortable with JSONPath, learning JMESPath is straightforward because the concepts are similar. jq is worth learning separately as a terminal tool for data processing tasks.
Can I use JSONPath to modify JSON, not just query it?
RFC 9535 defines JSONPath as a read-only query language — it selects values but does not modify them. Some JSONPath implementations provide non-standard assignment extensions ($.user.name = "Alice"), but these are not part of the standard. For standardized JSON modification, use JSON Patch (RFC 6902) or JSON Merge Patch (RFC 7396) which define explicit, safe update operations.
Is there a universal JSON query language supported everywhere?
Not universally. JSONPath has the widest tool support and RFC 9535 standardization, making it the closest to a universal option. However, each language — JSONPath, JMESPath, jq — has environments where it is the standard choice. Learning all three at a basic level is practical for professionals who work across different tools and platforms.
How do filter expressions work across different JSON query languages?
JSONPath filters use [?(@.field == value)] with @ as the current node. JMESPath filters use [?field == 'value'] with implicit current context. jq uses select(.field == "value") as a pipeline stage. All three support basic comparison operators, but function availability and syntax differ. Test filter expressions in a playground before deploying them in production scripts.