JMESPath Tester

Run JMESPath queries against your JSON and see the result as you type. JMESPath is the query language built into the AWS CLI (--query), boto3, and many other tools, so this is the fastest way to prototype a filter before pasting it into a script. Paste your JSON on the left, write an expression on the right, and the extracted value appears live. Everything runs locally — your data never leaves the page.

How to use the JMESPath Tester

Paste any JSON document into the input box and type a JMESPath expression in the field at the top. The result updates on every keystroke, so you can build a query piece by piece and watch it narrow down. The output is pretty-printed JSON — a string, number, object, array, or null when the path matches nothing.

The default example shows a filter projection ([?state=='WA']), a sub-expression (.name), and a pipe into the sort function. Swap in your own data to test slices like users[0:5], multiselect hashes like {id: id, label: name}, or functions such as length(@), max_by(@, &score), and keys(@). The exact same expression works in the AWS CLI's --query flag.

What is JMESPath

JMESPath is a query language for JSON, designed to extract and transform elements from a document with a compact expression. It is the engine behind the AWS CLI's --query option and the boto3 paginator filters, and has well-maintained implementations in Python, JavaScript, Go, Ruby, PHP, and several other languages, so an expression you test here behaves identically across all of them.

A basic expression is a chain of identifiers separated by dots — a.b.c reaches into nested objects. Square brackets index arrays (items[0]), slice them (items[1:3]), or flatten them (items[]). A projection applies the rest of the expression to every element of a list: people[*].name collects the name of each person. Filter expressions like people[?age > `30`] keep only the elements matching a condition.

Beyond navigation, JMESPath has functions (length, sort, sort_by, max_by, join, to_string, contains, keys, values), pipes (|) that stop a projection and feed its result into a new expression, and multiselect constructs that build new objects ({name: name, total: sum(orders[].price)}) or arrays on the fly. That combination lets a single line reshape a response into exactly the structure a script needs.

Common use cases

  • Prototyping AWS CLI queries. Build and verify a --query expression against sample output before scripting it.
  • Reshaping API responses. Pull just the fields you need from a large JSON payload into a flat structure.
  • Filtering arrays. Test filter expressions and projections without writing throwaway code.
  • Learning the syntax. Experiment with functions, pipes, and multiselect hashes interactively.

Frequently asked questions

Is my JSON uploaded anywhere?

No. The JMESPath expression is evaluated entirely in your browser using the official jmespath.js library loaded from this site. Your JSON never leaves the page, so it is safe for internal or sensitive data.

Is this the same JMESPath the AWS CLI uses?

Yes. The AWS CLI --query flag and boto3 use JMESPath, and this tester uses the reference jmespath.js implementation. An expression that works here works in the CLI, though remember the CLI applies the query to the API response shape, not to arbitrary JSON.

Why does my expression return null?

A null result means the path did not match anything — usually a misspelled key, the wrong nesting level, or a filter that excluded every element. Build the expression up one step at a time and watch where the result becomes null to find the break.

How do I write a literal value in a filter?

Wrap literals in backticks: numbers as `30`, strings as `"WA"` (or use single quotes, e.g. [?state=='WA']), and JSON literals like `true` or `null`. Raw string literals can also be written with single quotes, such as 'some text'.

Can it transform data, not just extract it?

Yes. Multiselect hashes ({a: x, b: y}) and multiselect lists ([x, y]) build new objects and arrays, and functions like sort_by, max_by, and join reshape results. A single expression can both filter and restructure a document.