JSON Path Tester
Runs 100% in your browserTest JSONPath expressions against any JSON document instantly. Evaluate wildcards, recursive descent, filter expressions, slices, negative indexes, and compound &&/|| filters — all private, all in your browser.
JSON document
Query matches
JSONPath (RFC 9535) is the standard query language for JSON — similar to XPath for XML. Use $ as the root, . for child properties, [*] for wildcards, .. for recursive descent, [?(@.price < 10)] for filters, and [0:2] for array slices. Compound filters with && and || are supported. All processing happens in your browser — no JSON is ever uploaded.
Recent queries
JSONPath evaluation runs entirely in your browser using vanilla JavaScript. Your JSON data never leaves your device — no upload, no server, no account required.
Frequently asked questions
JSONPath is a query language for JSON documents, analogous to XPath for XML. The root of a document is denoted by $, child properties by a dot ($.store.book), array elements by bracket notation ($[0]), and wildcards by * or [*]. Recursive descent (..) traverses all nested levels. JSONPath was originally described by Stefan Goessner in 2007 and is now standardised as RFC 9535.
$ is the root identifier — it always refers to the top-level element of the JSON document being queried. Every valid JSONPath expression must start with $. From $, you navigate into objects with dot notation ($.name) or bracket notation ($["name"]) and into arrays with numeric indexes ($.items[0]).
Use the wildcard operator: $.store.book[*] selects all elements of the book array. Combining it with a property name — $.store.book[*].title — selects the title property from every element. You can also use recursive descent: $..title selects every title at any depth in the document.
The recursive descent operator .. traverses all levels of the JSON tree. $..price finds every price property regardless of how deeply nested it is. $..* collects every single value in the document. It is equivalent to a depth-first walk that returns every matching node it encounters.
Filter expressions are written as [?(@.property operator value)]. The @ symbol refers to the current array element being tested. For example, $.store.book[?(@.price < 10)] returns all books with a price less than 10. Supported operators are ==, !=, <, >, <=, >=, =~ (regex match), and in (array membership). Compound filters using && (AND) and || (OR) are also supported: [?(@.price < 10 && @.category == "fiction")].
Compound filters let you combine multiple conditions in a single filter expression using && (both conditions must be true) or || (at least one condition must be true). Example: $.store.book[?(@.inStock == true && @.price < 15)] returns books that are both in stock and cost less than $15. ToolsSonic supports && and || in all filter expressions.
Use a numeric index in bracket notation: $.store.book[0] selects the first element, $.store.book[2] selects the third. Negative indexes count from the end: $.store.book[-1] selects the last element, $.store.book[-2] selects the second-to-last. Negative index support is a key enhancement over basic JSONPath implementations.
Array slices use the [start:end:step] notation — similar to Python slices. $.store.book[0:2] returns the first two books (indexes 0 and 1). $.store.book[1:] returns everything from index 1 onwards. $.store.book[::-1] would reverse the array. Negative start and end values count from the end of the array.
A union expression selects multiple keys or indexes in one step. $.store.book[*]['title','author'] selects both the title and author properties from every book. You can also union numeric indexes: $.store.book[0,2] selects the first and third books. String union keys must be quoted in single or double quotes.
Use the =~ operator in a filter: $.store.book[?(@.title =~ /Moby/)] returns all books whose title matches the regex /Moby/. The regex pattern is a JavaScript-compatible regular expression. You can use flags if wrapped in a forward-slash pattern. Example: [?(@.category =~ /fict/i)] for case-insensitive matching.
Dot notation ($.store.book) is shorthand for alphanumeric property names. Bracket notation ($["store"]["book"]) works for all property names, including those with spaces, hyphens, or special characters. Bracket notation also enables computed access, quoted string keys, and numeric array indexes. For most common property names, both forms are equivalent.
$..* (recursive descent + wildcard) collects every value at every level of the JSON document — every string, number, boolean, null, object, and array. On a large document this can return thousands of results. It is useful for searching the entire document or inspecting its full contents.
Both are JSON query languages. JSONPath (RFC 9535) uses XPath-inspired syntax with $ root, dot/bracket navigation, .., and [?(filter)]. JMESPath uses a different syntax with pipe expressions, multi-select lists, and built-in functions. JSONPath is more widely used in tooling (Kubernetes, Grafana, OpenAPI, Gatling), while JMESPath is standard in AWS CLI and SDKs. ToolsSonic implements JSONPath.
JSON Pointer (RFC 6901) is a simpler path format using slash-separated segments: /store/book/0/title. It always identifies exactly one value and is mainly used in JSON Patch and JSON Schema $ref. JSONPath is a full query language that can match multiple nodes, use wildcards, filter expressions, and recursive descent. For querying, use JSONPath; for referencing a single location, JSON Pointer is sufficient.
Yes. RFC 9535 (the 2024 IETF standard for JSONPath) formalised the grammar and semantics that ToolsSonic implements: $ root, . child, .. recursive descent, [*] wildcard, [n] index, [start:end:step] slice, [?(filter)] filter, and union selectors. ToolsSonic also adds compound && and || filter support and negative standalone array indexes.
Paste the full JSON response body into the JSON document panel. Type your JSONPath expression into the expression field and press Run (or Enter). Results appear instantly with path, type badge, and formatted value for each match. Use the Examples dropdown to start with a working query, then adapt it to your API structure. All processing is local — no data is sent anywhere.
Common causes: (1) Wrong operator — use == not === in JSONPath filters. (2) Type mismatch — if the JSON value is a number, compare against a number: [?(@.price < 10)], not [?(@.price < "10")]. (3) Wrong path — @ refers to the array element, not the root. (4) Extra whitespace — trim your expression. (5) Property name case — JSONPath is case-sensitive.
Once the ToolsSonic page has loaded in your browser, the JSONPath engine runs entirely in client-side JavaScript. You can paste JSON and run queries without an active internet connection. The page itself requires an initial load, but no server requests are made during evaluation.
Yes. The entire JSONPath evaluation engine runs in your browser using vanilla JavaScript. Your JSON data never leaves your device. There is no upload step, no server-side processing, no analytics on your data, and no account required. You can safely use this tool with sensitive API responses, configuration files, and internal data.
What is JSON Path Tester?
What Is a JSONPath Tester?
A JSONPath Tester is an online tool that evaluates JSONPath expressions against a JSON document and shows every matching result — including the full path, the value type, and the value itself. JSONPath is the standard query language for JSON (formalised as RFC 9535 in 2024), analogous to XPath for XML. Where XPath navigates an XML tree, JSONPath navigates a JSON tree: $ is the root, . is the child operator, [*] is the wildcard, .. is recursive descent, and [?(filter)] is the filter expression.
How ToolsSonic's JSONPath Tester Works
Full expression engine — in the browser. ToolsSonic implements the complete JSONPath grammar: dot and bracket child access, wildcard [*], recursive descent ..key, array index [n], negative indexes [-1] (last element), array slices [start:end:step], union selectors ['a','b'], regex filters [?(@.title =~ /Moby/)], and compound && / || filters — [?(@.price < 10 && @.category == "fiction")]. No server request is made; every query runs in your browser in milliseconds.
Live mode. Toggle *Live mode* to evaluate as you type — every keystroke re-runs the query and updates results immediately, matching the behaviour of JSONPath.com but without data leaving your device.
Result cards. Every match renders as a card showing the exact JSONPath string (e.g. $.store.book[2].title), a colour-coded type badge (string / number / boolean / object / array / null), the formatted value, and individual Copy path / Copy value buttons.
Six-stat bar. Below the results: match count, object count, array count, total node count, maximum document depth, and query byte size — giving you a structural summary at a glance.
10 built-in examples. The Examples dropdown includes: all book titles, all prices recursively, third book by index, last book by negative index, books under $10, in-stock fiction books (compound filter), union key selection, regex title filter, array slice, and full recursive wildcard.
JSONPath Syntax Quick Reference
| Expression | Meaning |
|---|---|
| $ | Root element |
| $.store | Child property store |
| $.store.book[*] | All array elements |
| $.store.book[0] | First element |
| $.store.book[-1] | Last element (negative index) |
| $..price | All price values recursively |
| $.store.book[0:2] | Slice — elements 0 and 1 |
| [?(@.price < 10)] | Filter — elements where price < 10 |
| [?(@.price < 10 && @.inStock == true)] | Compound AND filter |
| [?(@.title =~ /Moby/)] | Regex filter |
| ['title','author'] | Union — multiple keys |
JSONPath vs JMESPath vs JSON Pointer
JSONPath (RFC 9535) uses XPath-inspired syntax. It excels at querying API responses, Kubernetes resource fields, Grafana transformations, and OpenAPI examples. Most browser-based and Java/Go tooling uses JSONPath.
JMESPath is the query language of the AWS CLI and SDKs. It uses a different syntax with pipe expressions (|), multi-select lists ([a, b]), and built-in functions (length(), sort_by()). Use JMESPath for AWS resource queries; use JSONPath for everything else.
JSON Pointer (RFC 6901) is not a query language — it is a path reference format using slash-separated segments (/store/book/0/title). It always addresses exactly one value and is used in JSON Patch (application/json-patch+json) and JSON Schema $ref. It cannot express wildcards, filters, or recursive descent.
Common use cases
- Testing a JSONPath expression against a REST API JSON response before hardcoding it in code
- Exploring the structure of an unfamiliar JSON payload to locate nested fields
- Debugging Kubernetes kubectl JSONPath output expressions locally
- Writing Grafana JSON field override or transformation expressions
- Extracting specific fields from a deep API response for TypeScript or Python processing
- Verifying that a JSONPath filter expression returns the correct subset of array items
- Testing compound && / || filter conditions before using them in a query library
- Copying the exact JSONPath string of a value deep in a nested document
Why use ToolsSonic's JSON Path Tester?
ToolsSonic's JSON Path Tester implements the complete RFC 9535 JSONPath grammar and adds three enhancements no lightweight competitor offers: compound && / || filter expressions for multi-condition queries; negative standalone array index support ([-1], [-2]) for last-element access without knowing array length; and a live mode toggle that re-evaluates the query on every keystroke, matching the responsiveness of dedicated online evaluators. Each result card shows the full path, a colour-coded type badge (6 types), and individual Copy path / Copy value buttons. A six-stat bar (matches, objects, arrays, nodes, max depth, query bytes), 10 built-in examples, 8-item query history, and a downloadable plain-text report make it the most complete browser-based JSONPath tool available. No upload, no account, no install.
JSONPath Syntax Reference — All Operators
The table below covers every operator in the RFC 9535 JSONPath standard as implemented by ToolsSonic.
| Operator | Syntax | Description |
|----------|--------|-------------|
| Root | $ | The top-level element of the document |
| Child dot | $.key | Access a named child property |
| Child bracket | $["key"] | Access a property by quoted name (allows spaces/special chars) |
| Recursive descent | $..key | Find key at any depth in the document |
| Wildcard | [*] or .* | All children of an object or all elements of an array |
| Array index | [n] | The element at index n (zero-based) |
| Negative index | [-n] | Count from the end — [-1] is the last element |
| Array slice | [start:end:step] | Python-style slice — [0:2] returns first two elements |
| Union | [a,b] or ['a','b'] | Multiple keys or indexes in one step |
| Filter | [?(@.key op value)] | Select array elements matching a condition |
| Regex filter | [?(@.key =~ /pattern/)] | Select elements where key matches a regex |
| Compound AND | [?(@.a == 1 && @.b == 2)] | Both conditions must be true |
| Compound OR | [?(@.a == 1 \|\| @.b == 2)] | At least one condition must be true |
| In filter | [?(@.key in ["x","y"])] | Value must be in the provided array |
| Existence | [?(@.key)] | Element must have a truthy value at key |
| Negation | [?(!@.key)] | Element must not have a truthy value at key |
JSONPath vs JMESPath vs JSON Pointer — Comparison Table
| Feature | JSONPath (RFC 9535) | JMESPath | JSON Pointer (RFC 6901) |
|---------|--------------------|---------|-----------------------|
| Root | $ | implicit | ` (empty string) |
| Child access | $.key or $["key"] | key or "key" | /key |
| Array index | $[0] | [0] | /0 |
| Wildcard | [*] | [] | — |
| Recursive descent | $..key | — | — |
| Filter | [?(@.price < 10)] | [?price < 10] | — |
| Compound filter | && / || | && / || | — |
| Functions | — | length(), sort_by(), etc. | — |
| Multiple matches | ✅ | ✅ | ❌ (one value only) |
| Primary use | API querying, Kubernetes, Grafana, OpenAPI | AWS CLI/SDK | JSON Patch, JSON Schema $ref` |
| Standard | RFC 9535 (2024) | RFC 9535 draft / jmespath.org | RFC 6901 (2013) |
Related tools
JSON Tree Viewer
Editor's choiceExplore JSON as a searchable interactive tree with path-aware navigation, collapsible objects and arrays, node inspection, type badges, copy-path actions, statistics, and private browser processing.
JSON Formatter
Editor's choiceFormat, beautify, minify, and validate JSON locally. Choose indentation, sort keys, preserve Unicode, inspect statistics, and copy or download clean output.
JSON Editor
Editor's choiceEdit JSON online in a private browser-based editor with line numbers, live validation, syntax-aware formatting, key sorting, Unicode support, search, and local export — nothing uploaded.
JSON Validator
Editor's choiceValidate JSON online with precise line and column diagnostics, targeted repair hints, structure inspection, and browser-only processing — no upload, no account.
JSON Schema Validator
Editor's choiceValidate a JSON instance against a JSON Schema locally — Draft 4/6/7 and 2020-12 common subset, path-aware errors by keyword, type, format, required, composition, and local $refs. 100% browser-only, no upload.
JSON to TypeScript Interface
Editor's choiceConvert JSON to TypeScript interfaces, type aliases, or enums in your browser. Infer nested objects, arrays, unions, readonly modifiers, optional and nullable fields, safe names, and downloadable .ts definitions from any JSON sample.