JMESPath Query Tester for JSON
Write a JMESPath expression, run it against your JSON, and see the extracted result instantly. Ideal for building the exact query you need for AWS CLI --query flags, Ansible filters or any pipeline that reshapes API responses.
How to use
- Paste your JSON document into the data panel.
- Type a JMESPath expression such as users[?age > `30`].name.
- Run the query and iterate on the expression until the output matches what you need.
JMESPath is a declarative query language for JSON, a formal specification with a compliance test suite, which is why the same expression behaves identically in Python, Go, JavaScript and the AWS CLI. That portability is its superpower: an expression you perfect here can be dropped straight into aws ec2 describe-instances --query without translation.
The core operations are path traversal (a.b.c), indexing (users[0]), slicing (items[0:5]), projections (users[*].name applies the rest of the expression to every element), filters (users[?active == `true`]) and multiselect reshaping ({name: name, city: address.city}) which builds new objects from parts of old ones. Pipes (|) stop a projection so you can operate on the collected result, and built-in functions cover length(), sort_by(), max_by(), join() and more.
Two syntax rules cause most beginner errors. Literals in filters must be wrapped in backticks (`30`, `true`) or single quotes for raw strings, double quotes mean an identifier, not a string value. And projections silently produce null when applied to an object instead of an array, so if a query returns nothing, check whether the level you starred over is actually a list.
Note that JMESPath is not jq: jq is a separate program with a different, more procedural language. JMESPath deliberately omits jq features like arithmetic and variable assignment in exchange for being embeddable and spec-defined. This tester runs your expression server-side against the pasted document and keeps nothing afterwards.
Examples
Input: query: users[0].name data: {"users": [{"name": "asha"}, {"name": "rahul"}]}
Output: "asha"
Input: query: users[*].name data: {"users": [{"name": "asha"}, {"name": "rahul"}]}
Output: ["asha", "rahul"]
Input: query: [?price > `500`].sku data: [{"sku": "A", "price": 300}, {"sku": "B", "price": 900}]
Output: ["B"]
Frequently asked questions
Is JMESPath the same as jq?
No. They solve the same problem but are different languages. JMESPath is a spec with identical behaviour across many programming languages and powers the AWS CLI --query flag, jq is a standalone binary with a richer, more procedural syntax. Expressions are not interchangeable.
Why does my filter [?age > 30] return an error or nothing?
Number and boolean literals in JMESPath filters must be backtick-quoted: [?age > `30`]. Without backticks the parser reads 30 as malformed syntax. String comparisons use single quotes: [?city == 'Pune'].
Why do I get null instead of my values?
Usually the expression addresses a key that does not exist at that level, or applies a projection ([*]) to an object rather than an array. Query one level at a time (users, then users[*], then users[*].name) to find where the shape diverges.
Where is JMESPath used in the real world?
The AWS CLI and boto3 (--query and JMESPath selectors), Azure CLI --query, Ansible's json_query filter, and many API gateways use it for response filtering. Learning it once pays off across all of them.
Related tools
Velona is India's INR-native AI API gateway with 300+ models, UPI top-up from ₹10, no foreign card needed. These tools are free forever.