JSONPath / JMESPath Query Tool

Left JSON Input
Right Query Result
Ready. Paste JSON on the left and run a query.

JSONPath / JMESPath Query Tool

The JSONPath / JMESPath Query Tool helps you extract data from complex JSON quickly and accurately. Instead of manually scrolling through large documents, you can write a query to select exactly the values you need. This is essential for API debugging, log inspection, data transformation, and automation. Paste JSON, enter a query, and get results instantly—all in your browser.

JSONPath and JMESPath are two popular query languages for JSON. JSONPath is similar to XPath for XML and is widely used in developer tools. JMESPath is a powerful query language with filtering and projection features, commonly used in CLI tools and cloud platforms. This tool is optimized for practical usage and quick experimentation, so you can test queries before using them in scripts or production systems.

What you can do with JSONPath or JMESPath

  • Extract nested values without searching manually.
  • Select all items in arrays and filter by conditions.
  • Build custom outputs by projecting specific fields.
  • Validate API responses and confirm expected structures.
  • Create reusable queries for automation and tests.

How to use this query tool

  1. Paste JSON in the left editor.
  2. Select JSONPath or JMESPath mode.
  3. Enter your query and click Run Query.
  4. Copy the result or refine your query.

JSONPath examples

  • $.store.book[0].title — first book title
  • $.items[*].id — all item ids
  • $.users[?(@.active==true)].email — emails of active users
  • $.orders[*].total — list of totals

JMESPath examples

  • store.book[0].title — first book title
  • items[].id — all ids
  • users[?active==`true`].email — emails of active users
  • orders[].{id:id,total:total} — project id and total

Example JSON and query

Input JSON:

{
  "users": [
    { "id": 1, "name": "Avi", "active": true },
    { "id": 2, "name": "Riya", "active": false }
  ],
  "meta": { "count": 2 }
}

JSONPath query: $.users[?(@.active==true)].name

Result:

["Avi"]

Common errors and how to fix them

  • Invalid JSON: Queries require valid JSON. Run the JSON Validator to fix syntax issues.
  • No results returned: The path may be incorrect or the data doesn’t match. Confirm structure and key names.
  • Filter syntax errors: JSONPath and JMESPath have different filter syntax. Make sure you are using the correct mode.
  • Unexpected nulls: The query might point to missing keys. Use safe projections or check the JSON structure.
  • Large JSON performance: Very large files can slow down the browser. Limit input size or query smaller sections.

Best practices for JSON queries

  • Start with simple paths and build complexity step by step.
  • Use projections to output only the fields you need.
  • Validate JSON before querying to avoid confusing errors.
  • Combine this tool with JSON Search for quick keyword checks.

Practical use cases

API monitoring: Extract a status field or error code from large responses without manually scanning JSON.

Data cleanup: Use a query to pull only the fields you need before exporting to CSV.

QA and testing: Validate that specific values exist in test fixtures or sample payloads.

ETL pipelines: Build deterministic selectors for data extraction and transformation.

Query building checklist

  • Confirm the exact JSON structure with a formatter.
  • Start with the root ($ for JSONPath) or top-level keys for JMESPath.
  • Add array selectors and filters gradually.
  • Inspect results and refine filters to remove noise.

Quick query cheat sheet

  • $..id — find all id fields anywhere (JSONPath)
  • items[0] — first item (JMESPath)
  • items[?price > `20`] — filter by numeric value (JMESPath)
  • $.orders[?(@.total > 100)].id — filter by condition (JSONPath)
  • users[].{id:id,name:name} — projection (JMESPath)

Performance and reliability notes

Queries run entirely in your browser. For very large JSON files, consider extracting a smaller subset or using filters that reduce the result size. If you need repeatable results in production systems, save your query strings and include them in tests or automated scripts.

Edge cases to keep in mind

JSON keys are case-sensitive. A query that works for userId will fail for userid. Arrays are zero-indexed, so the first element is index 0. If you work with mixed data types, be explicit in filters to avoid ambiguous results.

If your JSON contains keys with spaces or special characters, you may need bracket notation in JSONPath (e.g., $['user name']). For JMESPath, wrap such keys in quotes if needed.

When working with dynamic payloads, keep your queries resilient by avoiding overly specific paths. Favor broad selectors with filters so changes in ordering or optional fields do not break your results.

If you are building reusable queries, store them in version control alongside sample JSON. This makes it easier to review changes, test queries, and share them across teams.

For complex payloads, add comments in documentation around each query so future readers know the intent.

This makes query maintenance easier as APIs evolve.

As a rule, keep a small library of trusted queries for the most common response shapes.

This improves consistency across teams.

It also saves time.

FAQs

What is the difference between JSONPath and JMESPath?
JSONPath is more XPath-like and common in developer tools. JMESPath is popular in cloud CLIs and supports powerful projections.

Which one should I use?
Use the one your platform or team already uses. This tool helps you test both quickly.

Can I query arrays?
Yes. Both JSONPath and JMESPath support array selections and filters.

Why do I get an empty result?
The path may not match your JSON. Double-check key names and array indices.

Is my data uploaded?
No. All queries run locally in your browser.

Can I use this for API debugging?
Absolutely. It’s perfect for extracting specific values from large responses.

Does JSONPath support wildcards?
Yes. Use * to select all properties or array items.

Can I query deeply nested arrays?
Yes, but be precise with paths and indices to avoid empty results.

Will the query modify my JSON?
No. Queries only read data and return results.

How can I debug a complex query?
Start with a broad query, then narrow it step by step until you isolate the correct path.

Can I chain multiple filters?
Yes. Apply filters in sequence or use compound conditions depending on the query language.

Keyword‑targeted phrases

  • jsonpath query tool
  • jmespath query online
  • json query online
  • jsonpath tester
  • json query result