JSONPath Tester
A JSONPath Tester lets you write a JSONPath expression and immediately see which values it extracts from a JSON document, without writing any code. It is the fastest way to validate query expressions before using them in an application, API gateway, or data pipeline.
$Root
$.keyChild key
$..keyRecursive
[*]All items
[0]First item
['k']Bracket notation
What Is a JSONPath Tester?
A JSONPath Tester is a browser-based tool that lets you write a JSONPath expression, paste a JSON document, and instantly see which values the expression matches. Instead of running a script, deploying code, or wiring up a debugger, you get immediate visual feedback: the matched nodes are highlighted or listed alongside their paths, so you can refine your query until it extracts exactly the data you need.
JSONPath itself is a query language for JSON, originally described by Stefan Goessner in 2007 and formally standardised as RFC-draft JSONPath (Goessner specification). It plays the same role for JSON that XPath plays for XML: it gives you a concise, readable syntax to navigate an object tree and extract one value, a filtered subset, or every occurrence of a key regardless of how deeply it is nested. The IETF has since published a more formal specification at RFC 9535, which codifies JSONPath as an internet standard.
The language is built around a handful of operators. The dollar sign ($) represents the root of the document. The dot (.) navigates to a child key. Square brackets ([]) access array indices or child keys by name. The double dot (..) performs a recursive descent, searching every level of the tree for a matching key. The asterisk (*) is a wildcard that matches all children. Filter expressions written as [?(@.price < 10)] select array elements that satisfy a boolean condition. Together, these operators let you write expressions ranging from the trivially simple ($.name) to the highly targeted ($.store.book[?(@.category == "fiction")].title).
JSONPath is supported natively or via libraries in virtually every major programming language and platform, including JavaScript (jsonpath-plus), Python (jsonpath-ng), Java (Jayway JsonPath), PHP, Ruby, Go, and SQL Server's JSON_VALUE function. It is also built into infrastructure tools such as Kubernetes (kubectl uses JSONPath for output formatting), AWS Step Functions, and Splunk. A dedicated tester removes the overhead of setting up any of those environments just to verify a single expression.
How to Use the JSONPath Tester
- Paste your JSON document into the input panel on the left. This can be a raw API response copied from your browser's developer tools, a sample payload from API documentation, or any valid JSON string. If your JSON is minified, the tool will still parse it correctly.
- Write your JSONPath expression in the expression field. Start with the root selector
$and navigate down with dots and brackets. For example, to get all book titles from a store object, you would write$.store.book[*].title. - Run the expression by clicking the test or evaluate button. The tool parses the JSON, evaluates the expression, and returns the matched values in real time.
- Review the results. Matched values appear in the output panel. If the expression matched nothing, check for typos in key names (JSONPath is case-sensitive), confirm the structure of your JSON, and try a broader expression such as
$..*to see all values at all levels. - Use filter expressions to narrow results. Once you have a working base path, add a filter to select only elements meeting a condition. For example,
$.users[?(@.active == true)].emailextracts email addresses of active users only. - Test edge cases such as missing keys, empty arrays, and null values to confirm your expression handles real-world data gracefully before putting it into production code.
- Copy the validated expression directly into your application, API gateway configuration, or data pipeline once you are satisfied with the results.
Why Use This Tool
JSONPath expressions are easy to write incorrectly. A missing bracket, an off-by-one array index, or a case mismatch in a key name will silently return zero results rather than throwing an error in most libraries. Running every small query change through a full application cycle is slow and frustrating; a dedicated tester gives you a tight feedback loop that takes seconds rather than minutes.
Back-end engineers querying REST API payloads, data engineers building transformation pipelines in AWS Glue or Apache NiFi, DevOps engineers writing Kubernetes output templates, and QA engineers verifying webhook payloads all encounter JSONPath regularly. For each of them, the ability to validate an expression against a real payload before it goes anywhere near production code reduces bugs and speeds up development.
Beyond individual development tasks, JSONPath testers are valuable in collaborative settings. A product manager or solutions engineer who needs to extract a specific field from an API response can use the tester without writing any code, making it useful well beyond engineering teams. Analytics platforms such as Splunk and Elasticsearch both support JSONPath-style queries for log extraction, meaning data analysts working in those environments benefit just as much as software developers.
The RFC 9535 JSONPath specification documents the full operator set and expected behaviour across compliant implementations, making it the authoritative reference when an expression behaves unexpectedly in a specific library.
Real-World Use Cases
API integration developer extracting nested fields
A back-end developer at a fintech company is integrating with a payment provider's webhook. The webhook payload is a deeply nested JSON object with transaction data buried under $.event.data.object.charges.data[0].amount. Rather than adding logging to a running application to inspect the structure, the developer pastes one sample payload into the JSONPath Tester, writes the expression, and confirms it resolves to the correct integer in under a minute. The validated expression goes straight into the Node.js event handler.
DevOps engineer formatting kubectl output
A platform engineer needs to extract the image name for every container in a Kubernetes deployment object using kubectl get deployment -o jsonpath. The Kubernetes JSON structure is verbose and unfamiliar. The engineer pastes the raw kubectl get deployment -o json output into the tester and iterates on the expression $.spec.template.spec.containers[*].image until it returns the correct list. The confirmed expression is then embedded in a shell script used across the team's CI/CD pipeline.
Data engineer building an ETL transformation
An analytics engineer at an e-commerce company receives daily JSON exports from Shopify. Each export contains an array of orders, each with nested line items, discount codes, and shipping addresses. She uses the JSONPath Tester to draft and verify the extraction expressions she will pass to Python's jsonpath-ng library before writing the full Pandas transformation. Testing expressions against a representative sample before coding the pipeline prevents silent data loss from expressions that appear correct but match the wrong nesting level.
QA engineer validating API contract compliance
A QA engineer is writing automated API contract tests using Postman. Each test needs a JSONPath expression to assert that a specific field in the response has the expected value. Using the tester with real response payloads captured from the staging environment, the engineer confirms every assertion expression before embedding it in the test suite. This prevents false-positive passes caused by expressions that resolve to null rather than failing when a field is absent.
Common Mistakes and Troubleshooting
1. Forgetting the root selector $
Every valid JSONPath expression must begin with $, which represents the document root. Writing .store.book instead of $.store.book will either return an error or an empty result depending on the library. Always start with $.
2. Case-sensitive key names returning no results
JSONPath key matching is case-sensitive. If your JSON has "UserID" but your expression uses $.userid, the query returns nothing. Inspect the raw JSON carefully and match the exact casing. If you are unsure, use $..* to list all keys and values at every level, which makes it easy to spot the correct casing.
3. Incorrect array indexing (zero-based vs. one-based)
JSONPath arrays are zero-indexed, matching JavaScript and Python conventions. The first element is at index [0], not [1]. Developers coming from XPath, which uses one-based indexing, frequently make this mistake. If your expression targets a specific array element and returns the wrong value, subtract one from the index.
4. Using a single dot where a recursive descent is needed
If the key you want is nested at an unknown or variable depth, a single dot path such as $.data.name only works if name is exactly one level below data. Use the recursive descent operator .. to search all levels: $..name returns every value associated with the key name anywhere in the document. Be aware that this can return more matches than expected in large documents.
5. Filter syntax errors in bracket expressions
Filter expressions must follow the syntax [?(@.field operator value)]. The @ symbol refers to the current array element, not the document root. A common mistake is writing [?($.field == value)], which either errors or returns unexpected results. String values in filters must be quoted: [?(@.status == "active")], not [?(@.status == active)].
6. Expecting results from a non-array with a wildcard slice
The wildcard [*] and slice syntax [0:2] are array operations. Applying them to an object key that holds a plain value rather than an array returns nothing. Before using array operators, confirm in the tester that the target node is actually an array. If a key sometimes holds a single object and sometimes an array (a common inconsistency in third-party APIs), you may need to handle both cases in your application code.
S. Siddiqui
Founder & Editor-in-Chief, YourToolsBase
How JSONPath saved me an hour of API debugging in five minutes
I was integrating a South Asian logistics provider's webhook for a client's order management build. The payload came back as a deeply nested object, six levels deep in places, and the field I needed, the tracking reference, was buried somewhere inside a data.shipment.parcels array. I had no documentation, just a sample payload and a deadline.
I copied the entire JSON response into the JSONPath Tester and typed $..trackingRef. Nothing. I tried $..tracking_ref and got a match instantly. The field used underscore casing, not camelCase. That single discovery saved me at least 45 minutes of adding console.log statements, deploying, firing test webhooks, and reading server logs.
I now keep a JSONPath Tester tab open permanently when I am working with any API I have not built myself. I have used it to validate Step Functions input paths, format kubectl output for shell scripts, and check Elasticsearch query filters before they go anywhere near a production index. The tight feedback loop it provides is genuinely one of the most underrated things in a developer's day-to-day toolkit.
Frequently Asked Questions
What is the difference between JSONPath and XPath?
What does the $ symbol mean in a JSONPath expression?
How do I select all elements of an array using JSONPath?
Can JSONPath filter array elements by a condition?
Why does my JSONPath expression return an empty result?
What is the difference between dot notation and bracket notation?
Is JSONPath supported in Python?
Does JSONPath work when the JSON root is an array?
Is JSONPath an official internet standard?
Can I use JSONPath in SQL Server or PostgreSQL?
Rate This Tool
Was this tool helpful?
Be the first to rate this tool
About the Author
S. Siddiqui is the founder and editor-in-chief of YourToolsBase, overseeing all content, tool accuracy, and editorial standards.
View full profileAuthoritative Sources
Formulas and data in this tool are based on guidelines from the above sources.