πŸ” Utilities

JSON Path & jq Query Tester

Paste JSON and test dot-notation, bracket-notation, array filters, recursive descent and jq-style expressions live in your browser. Great for debugging API responses, kubectl output and config files.

πŸ“„ JSON Input
πŸ”Ž Query
βœ… Result
Enter a query above to see results…
πŸ“‹ Query Cheatsheet
Note: This tool implements a subset of JSONPath and dot-notation syntax that covers the most common use cases. For full jq or JSONPath spec compliance, use the respective CLI tools (jq, jsonpath) or language libraries.
πŸ“– How to Use This Tool
β–Ό
1
Paste JSON data in the left panel
2
Enter query: $.store.book[0].title
3
Choose mode: dot notation, JSONPath, or jq
4
Results highlight matched values
πŸ“ Examples
Array
Input: $.users[0].name
Output: Returns first user's name

What Not to Paste Into a Query Tester

Because this evaluator runs a real query engine over your input entirely inside the browser tab β€” no network call, no server round trip β€” it's technically safe to paste production JSON here without transmitting it anywhere; the practical risk isn't the tool, it's the habit. Pasting a live API response that happens to contain a customer's access token, a database connection string, or an internal service's auth header into any browser tab β€” this one included β€” puts that secret into browser history, extension-visible DOM state, and potentially a screen-share, none of which are risks worth taking just to test a path expression. The safer default is to redact or replace real secret values with placeholder strings of the same shape before pasting, and save the real data test for a terminal-only workflow where nothing renders on screen.

The Same Query in jq, jsonpath-ng, and Here

This tool's jq mode implements a working subset of real jq syntax β€” keys, length, type, map(), and select() β€” specifically so an expression prototyped here has a real chance of working unmodified when it's later run through the actual jq binary in a shell pipeline, for example kubectl get pods -o json | jq '.items[] | select(.status.phase=="Running") | .metadata.name'. The JSONPath mode serves the same bridging purpose for languages that consume JSONPath natively, like Python's jsonpath-ng library or Java's Jayway JsonPath β€” but the two dialects are not interchangeable: a filter written as [?(@.status=="failed")] in JSONPath mode has no direct jq equivalent without rewriting it as a select() pipe, and testing an expression in the wrong mode for its eventual runtime is a common way a query that "worked in the browser" mysteriously fails once it's dropped into the target script.

Chasing a CrashLoopBackOff Through Nested JSON

Take a real kubectl get pods -o json dump where you need the image tag of every container currently stuck in CrashLoopBackOff. Paste the full output into the input panel first. Then write a JSONPath filter: $.items[?(@.status.containerStatuses[0].state.waiting.reason=="CrashLoopBackOff")].metadata.name β€” this walks every pod object, checks the first container's waiting-state reason field, and returns only the pod names where it matches. Once that filter confirms which pods are affected, change just the trailing path segment to .spec.containers[0].image and re-run β€” same filter condition, different extracted field, now showing exactly which image tag is crash-looping across the cluster. That adjust-one-segment, re-run-instantly loop is the entire value of testing the expression here rather than against a live cluster, where each iteration costs a full kubectl round trip.

Where This Kind of Query Actually Gets Used

Frequently Asked Questions

What is JSONPath?

JSONPath is a query language for JSON data, analogous to XPath for XML documents. It allows you to navigate and extract values from complex, deeply nested JSON structures using concise path expressions. Expressions start with $ (the root), followed by dot or bracket notation to traverse keys and arrays. For example, $.users[*].email returns the email field from every user object in the users array. JSONPath is widely used in API testing tools like Postman, monitoring systems, and data transformation pipelines.

What query modes does this tool support?

The tool supports three query modes. Dot notation is the simplest: just write a path like store.books[0].title without any leading symbol. JSONPath mode follows the standard specification, requiring a leading $ and supporting full features including recursive descent (..), wildcards ([*]), and filter expressions ([?(@.price < 10)]). The jq mode implements popular jq built-ins like keys, values, length, type, map(.field), and select(.field == "value"), giving you an interactive alternative to the jq command-line tool without leaving your browser.

How do I filter an array by a field value in JSONPath?

Use a filter expression with the syntax [?(@.fieldName=="value")]. The @ refers to the current array element being evaluated, and you can use comparison operators like ==, !=, >, and <. For example, $.products[?(@.category=="electronics")].name returns the names of all products in the electronics category. Filter expressions are extremely useful when processing API responses that contain mixed-type arrays and you need to isolate records matching specific criteria.