{ }jsonkit
Format
Validate
Convert
Query
Generate

JMESPath tester

Try filters, projections, pipes and functions like contains() on JSON or YAML.
Input
Output
$live results as you type · ⌘↵ to re-run
175 B · paste or drop a file
1 2 3 4 5 6 7
✓ complete175 B → 22 B0.0 ms

About JMESPath Tester

The JMESPath tester runs JMESPath expressions against JSON or YAML and shows the result as formatted JSON or YAML. Use it to build the query for an AWS CLI --query option, an Ansible json_query filter or any JMESPath library.

It uses the JMESPath Community Edition library, so the full expression syntax and function library work, including contains(), length(), sort_by() and multiselect hashes.

Runs in your browser. Nothing is uploaded, so you can test against real API responses and config files.

How it works

Select fields and project arrays

Use dotted identifiers such as customer.address.city. A wildcard like people[*].name projects one field across every item. Indexes, negative indexes and slices such as [0:2] pick items by position.

Filter with comparisons

Filters keep matching items, for example people[?age >= `18`].name. Backticks mark a JSON literal, so `18` is a number and `true` is a boolean. Single quotes mark a raw string.

Pipes and functions

A pipe passes the result to the next expression, like people[*].age | max(@). Functions include contains, length, keys, sort_by, max_by, join and to_string.

YAML input

Set Input to YAML to query a YAML file directly. Anchors are resolved, and a file with several --- documents becomes an array you can index. Set Output to YAML to get the result back as YAML.

Frequently asked questions

How do I filter an array by a numeric field?

Use a filter followed by a projection, for example people[?age >= `18`].name. The backticks make JMESPath treat 18 as a number, not text.

How does contains() work in JMESPath?

contains(subject, search) is true when a string contains a substring or an array contains a value. For example people[?contains(name, 'a')].name returns every name with a lowercase a.

Why did my query return null?

A field that does not exist evaluates to null, and so does an index past the end of an array. Check the key names and the nesting.

Is JMESPath the same as the AWS CLI --query syntax?

Yes. The AWS CLI uses JMESPath for --query, so an expression that works here works there, as long as it does not use a function added by the Community Edition.

Can I query YAML with JMESPath?

Yes. Set Input to YAML. The YAML is parsed first, so the same expressions work on Kubernetes, Compose and CI files.

Sources & last verified

We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.

Found a wrong result or an outdated claim? Report an error and we will check it again.