🔍

jq & JMESPath Playground

Real jq 1.8.2, and JMESPath that matches the AWS and Azure CLIs. Runs in your browser.
JMESPath ready
Examples:
0 lines
⊞ DROP JSON FILE HERE
Output

                
Input: — Output: — Status: — Runtime: —
Share MySysAd

⚠️ IMPORTANT DISCLAIMER: The tools and scripts on this site are provided "AS IS" for educational purposes.

Review destructive commands before executing. By using this site, you assume all risk and agree to our Full Terms of Service.

Test jq filters and JSON queries before you script them

Two query languages in one place. jq is the real jq 1.8.2, built for the browser, for shell pipelines, kubectl and API output. JMESPath is the language of the AWS CLI and Azure CLI --query option, and this engine gives the answers they give. Paste a JSON response, type a query and see the result as you go; when it comes back empty, a hint says why, and the command line is ready to paste into bash or PowerShell.

Common questions

How do I filter AWS CLI output with --query?

Use a filter expression: aws ec2 describe-instances --query 'Reservations[].Instances[?State.Name==`running`].InstanceId' --output text lists running instance IDs. Paste the full JSON output here to build the query step by step, then copy the CLI line, which is quoted for bash or PowerShell.

How do I filter JSON with jq?

Pipe it in and select what you need: kubectl get pods -o json | jq '.items[] | select(.status.phase == "Running") | .metadata.name' lists running pods. Add -r for plain text without quotes, and @tsv or @csv for columns.

Is JMESPath the same as jq?

No. Both query JSON but the syntax differs: jq’s .items[] | select(.state == "running") | .name is items[?state=='running'].name in JMESPath. Use JMESPath with the AWS and Azure CLIs, and jq in shell pipelines. This page runs both: pick one at the top left.

Why does my query return an empty list or null?

Usually a wrong path (keys are case-sensitive), a key read from a list instead of from each item, or the quotes: in JMESPath, text goes in single quotes and double quotes mean a key name, so [?State.Name=="running"] finds nothing. The page explains what matched nothing and offers a fix that works on your data.

Does it give the same results as the AWS CLI?

Yes. The JMESPath engine follows Python’s jmespath, the library inside the AWS CLI and the Azure CLI. It passes all 892 cases of the official JMESPath compliance suite and matches Python on thousands of random queries: big whole numbers stay exact, 8.0 stays 8.0, and text is counted in characters.

How do I sort or find the largest item?

In JMESPath, sort_by(@, &LaunchTime) sorts a list by a field and max_by(@, &Size) gets the biggest. In jq, sort_by(.LaunchTime) and max_by(.Size) do the same. length(@) and length count items.

Related tools: JSON Formatter · Data Transformer · All tools A–Z