Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

JSONPath & JMESPath Tester

Standard JSONPath and AWS-style JMESPath queries, evaluated live on your JSON.

Developer No upload Works offline Free, no sign-up

Next steps

About the JSONPath & JMESPath Tester

Paste a JSON document and type a query: the result updates as you type. JSONPath follows RFC 9535, the IETF standard — every match is listed with its normalized path ($['store']['book'][0]), marked in the document, and one click selects it in the editor. JMESPath follows jmespath.py, the implementation behind the AWS CLI's --query option, so you can build a query here and copy it straight into your shell.

Both languages are interpreted, never run as code, and both implementations pass every case of their official test suites: the JSONPath Compliance Test Suite and the JMESPath compliance tests. Numbers keep every digit, and the page works offline once loaded — nothing you paste leaves your device.

How to use it

  1. Choose JSONPath (RFC 9535) or JMESPath (AWS CLI).
  2. Paste your JSON, open or drop a .json file, or press Load sample (the RFC's bookstore for JSONPath, an aws ec2 describe-instances-style response for JMESPath).
  3. Type an expression, or choose one from Examples. Errors show the position with a marker under the expression; Select in the expression highlights it.
  4. For JSONPath, read the Matches (normalized path and value; Show selects the value in the editor and outlines it in the highlighted document), or switch to Values (a JSON array) or Paths.
  5. For JMESPath, pick the JSON layout (4 spaces looks like the AWS CLI) and use Copy as --query to get the quoted argument for bash or zsh.

Examples

JSONPath: titles of books under 10 (on the sample bookstore)
Input
$..book[[email protected] < 10].title
Result
["Sayings of the Century", "Moby Dick"]
JSONPath: normalized paths of the matches
Input
$.store.bicycle.*
Result
$['store']['bicycle']['color']
$['store']['bicycle']['price']

Normalized paths always use brackets, so they are unambiguous for any member name.

JMESPath: IDs of running EC2 instances
Input
Reservations[].Instances[?State.Name=='running'].InstanceId[]
Result
["i-0123456789abcdef0", "i-0123456789abcdef2"]
JMESPath: copied as an AWS CLI argument
Input
Reservations[].Instances[].{ID: InstanceId, Type: InstanceType}
Result
--query 'Reservations[].Instances[].{ID: InstanceId, Type: InstanceType}'

Single quotes inside the expression are written as '\'' so that bash and zsh pass it through unchanged.

Common uses

  • Working out a JSONPath for an API test, a Kubernetes or OpenAPI tool, or a database that implements RFC 9535.
  • Building an aws … --query or az … --query expression against a saved response before running it for real (the Azure CLI uses JMESPath too).
  • Finding where values sit in a large document: every JSONPath match comes with its exact path.
  • Checking whether an expression written for another JSONPath library is standard RFC 9535.

JSONPath (RFC 9535) in short

A query starts with $, the whole document, followed by steps: .name or ['name'] for an object member, [0] or [-1] for an array element, [1:3] for a slice, * for every child and .. for every depth. [?…] keeps the children for which a filter is true; inside it @ is the child being tested: $..book[[email protected] < 10 && @.category == 'fiction']. Filters can test that something exists ([[email protected]]), compare values, and call five functions: length(), count(), match(), search() and value().

RFC 9535 is stricter than many older JSONPath libraries, and this tester reports their syntax as errors rather than guessing: script expressions such as [(@.length-1)] (write [-1]), =~ (use match() or search()), in, and .length as a property (use length() in a filter). Comparisons need singular queries — @.a, @['b'][0] — because a query such as @.tags[*] can select several values; use count() or value() for those.

Regular expressions in match() and search()

match() succeeds when the whole string matches the pattern, search() when part of it does. Patterns are I-Regexp (RFC 9485), a small subset that works the same everywhere: characters, ., […] classes, *, +, ?, {n,m}, |, groups and Unicode categories such as \p{Lu}. There is no \d, \w or \s (write [0-9]), no look-ahead and no back-references, and . does not match a line break. A pattern that is not valid I-Regexp makes the function false, as the standard says. Queries stop after 3 seconds, so a pattern that backtracks badly cannot freeze the page.

JMESPath as in the AWS CLI

Reservations[] flattens a list and [*] and .* project over lists and objects: the rest of the expression is applied to each item, and items that give null are dropped. A pipe | stops the projection. [?State.Name=='running'] filters, {id: InstanceId} and [a, b] build new objects and lists, 'text' is a string, and JSON literals go in backticks. A missing field gives null rather than an error.

This tester follows jmespath.py, the library the AWS CLI uses: < and > also compare strings, the 26 built-in functions (sort_by(), max_by(), join(), to_number()…) have the same type rules and error cases, and the numbers they compute are written as Python writes them — the average of 2 and 4 is 3.0.

JSONPath or JMESPath?

  • JSONPath selects parts of a document and tells you where they are; it is an IETF standard, which makes it a good choice for configuration, tests and APIs that must behave the same in every language.
  • JMESPath reshapes data: projections, multi-select lists and hashes, pipes and functions turn a large response into exactly the list or table you want, which is why the AWS and Azure command-line tools use it for --query.

Limitations

  • Only standard syntax is accepted: extensions of other JSONPath libraries (Jayway, JSONPath-Plus) and of the newer "JMESPath Community" edition (let expressions, arithmetic) are reported as errors.
  • The document must be strict JSON; comments, trailing commas or single quotes are reported with their line and column.
  • Matches are highlighted in documents up to 400 KB and listed up to 2,000; every match is counted, and Values, Copy and Download contain all of them — up to 20 million characters, beyond which the tester asks for a narrower query instead of running out of memory.
  • A query that takes longer than 3 seconds is stopped.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

Is my JSON uploaded?

No. Parsing and every query run in your browser, in a background worker; nothing is sent anywhere, and the page works offline once loaded.

Why does $.store.book.length return nothing?

In RFC 9535, .length means a member called "length", and arrays have none. length() and count() are used inside filters — for example $..book[?length(@.title) > 15] — and the last element of an array is [-1]. The number of matches of any query is shown above its results.

Why is my comparison rejected as "not a singular query"?

A comparison needs one value on each side. @.price or @.tags[0] select at most one value, but @.tags[*] or @..price can select several, so RFC 9535 does not allow them in a comparison. Use count(@.tags[*]) > 0, or put a filter inside: $[[email protected][?@ == 'sale']].

How do I use the JMESPath expression with the AWS CLI?

Press Copy as --query and paste the result after your command, e.g. aws ec2 describe-instances --query 'Reservations[].Instances[].InstanceId'. The quoting is for bash, zsh and other POSIX shells; PowerShell and the Windows command prompt quote differently.

Why does JMESPath give null instead of an error?

JMESPath returns null for anything that is missing — a field that does not exist, an index past the end, a filter on something that is not a list. Errors are reserved for invalid syntax and for functions called with the wrong types, such as abs('x').

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.