JSONPath Tester
Test JSONPath expressions against JSON data instantly. Validate JSON, query nested objects and arrays, inspect matching values and paths, and copy or download results.
JSON Input
0 charactersQuery Results
0 matchesAll Developer Tools
Browse free online tools for JSON, HTML, CSS, XML, JavaScript, data conversion, and everyday development tasks.
Try a different search term or select another category.
What Is a JSONPath Tester?
A JSONPath tester is a tool that evaluates JSONPath expressions against a JSON document and displays the values that match your query. It helps developers navigate nested objects, select array items, find properties, and filter structured data without manually searching through the entire document.
JSONPath is a query language for selecting values from JSON data. Its syntax includes a root selector, property selectors, array indexes, wildcards, recursive descent, slices, and filter expressions. An expression such as $.store.book[*].author selects the author property from every book in the store's book array.
Use this online JSONPath tester to explore API responses, inspect webhook payloads, test query expressions, or troubleshoot data extraction rules. Enter a JSON document and a JSONPath expression to evaluate the query and inspect its matching results.
Important: JSONPath selects values from JSON data. It does not repair invalid JSON or change the original document. The available expression syntax and result format can vary between JSONPath implementations.
How to Use a JSONPath Tester Online
Testing a JSONPath expression involves providing a JSON document, writing a query, and checking the values it selects.
Paste a valid JSON object or array into the input editor. Include the properties and nested data that you want to search.
Start with the root selector $, then add property names, array indexes, wildcards, or filters to identify the data you need.
Run the query or review the updated result if the tester evaluates expressions automatically as you type.
Review the returned values, match count, and matched paths if these details are provided by the tool.
Adjust the expression until it selects the intended data, then copy or reuse the result in your development workflow.
Quick JSONPath Examples
Select all book authors
Find every price in the document
Select books priced below 10
Sample JSON for Testing Expressions
The following sample JSON represents a store containing three books. Use it to understand how JSONPath navigates nested objects, selects array elements, and filters values by price or availability.
This document contains a root object, a nested store object, a book array, individual book objects, and a location object. Each book has a title, author, price, and availability flag.
Example: Select All Book Authors
This expression selects the author property from every object in the book array.
Example: Find All Prices
The recursive descent operator searches descendants of the current node for matching properties. This expression selects every property named price anywhere in the document.
Example: Filter Books by Price
This filter selects book objects whose numeric price is lower than 10. The result contains the first and third books in the sample JSON.
JSONPath Syntax Reference
JSONPath expressions combine selectors and operators to describe which values should be returned. This reference covers commonly used syntax for navigating objects and arrays.
| Expression | Meaning | Example |
|---|---|---|
$ |
Selects the root of the JSON document. | $.store |
.key |
Selects a child property using dot notation. | $.store.book |
["key"] |
Selects a property using bracket notation. | $["store"]["book"] |
[0] |
Selects the first array element using a zero-based index. | $.store.book[0] |
[-1] |
Selects the last array element in implementations that support negative indexes. | $.store.book[-1] |
[*] |
Selects all elements of an array or all child values of an object. | $.store.book[*] |
[0,2] |
Selects multiple array indexes using a union in implementations that support this syntax. | $.store.book[0,2] |
[1:3] |
Selects a slice from index 1 up to, but not including, index 3. | $.store.book[1:3] |
..key |
Searches descendants recursively for a property with the specified name. | $..author |
[?()] |
Filters array elements using a condition. | $.store.book[?(@.price < 10)] |
@ |
Refers to the current node inside a filter expression. | $[?(@.active)] |
Syntax compatibility: Not every evaluator supports every JSONPath extension. Negative indexes, unions, slices, and advanced filters may behave differently depending on the implementation used by the tester.
Understanding JSONPath Selectors
Selectors are the basic building blocks of a JSONPath expression. They determine which properties, elements, or nested values are selected from the input document.
Root Selector
The dollar sign $ represents the root node of the JSON document. Every absolute JSONPath expression starts from this location.
This selects the store's name from the sample JSON.
Child Selector
Dot notation selects a child property by name. Bracket notation provides another way to access properties, including names that need quoting.
This selects the city property inside the store's location object.
Array Index
Array indexes identify specific elements. JSON arrays use zero-based indexing, so index 0 represents the first element.
This selects the title of the first book.
Wildcard Selector
The wildcard * selects all child elements at the current location, subject to the surrounding expression.
This returns the title of every book in the array.
Recursive Descent
The .. operator searches nested descendants for a property, even when the property appears at different depths.
This finds all matching price properties throughout the document.
Bracket Notation
Bracket notation is helpful when a property name contains spaces, punctuation, or characters that are not convenient for dot notation.
This selects the same city property as the dot-notation expression.
Using JSONPath Filter Expressions
Filter expressions select elements that satisfy a specified condition. They are especially useful when an array contains many objects and you only need records with particular values.
In common JSONPath filter syntax, @ represents the current item being evaluated, while ?() introduces the filter condition.
Filter by Numeric Value
This expression returns books with a price lower than 10. With the sample data, the matching books are JSON Basics and Web Development.
Filter by Boolean Value
This expression selects books where the inStock property is explicitly set to the boolean value true.
Filter by Exact Text
This expression finds the book object whose author is exactly Grace Hopper. String matching is generally case-sensitive unless the specific implementation defines other behavior.
Filter Using Multiple Conditions
This combines two conditions: the price must be below 10 and the book must be in stock. Only books satisfying both conditions are selected.
Common Comparison Operators
| Operator | Meaning | Example |
|---|---|---|
== |
Equal to | @.author == "Ada Lovelace" |
!= |
Not equal to | @.price != 10 |
< |
Less than | @.price < 10 |
<= |
Less than or equal to | @.price <= 10 |
> |
Greater than | @.price > 10 |
>= |
Greater than or equal to | @.price >= 10 |
&& |
Logical AND in implementations that support it | @.price < 10 && @.inStock == true |
|| |
Logical OR in implementations that support it | @.price < 10 || @.inStock == false |
Tip: Use the operator syntax supported by your JSONPath evaluator. Some implementations offer additional comparison, existence, regular-expression, or logical operators, while others provide a smaller subset.
Useful JSONPath Examples
These common queries demonstrate how to select individual values, return multiple results, search nested properties, and filter an array.
Select One Value
Selects the title of the first book.
Select Every Book Title
Returns the title from each book in the array.
Search for a Property Anywhere
Searches through descendants of the root for properties named price.
Select Books Below a Price
Returns the complete book objects whose price is less than 10.
Select Books That Are in Stock
Selects book objects whose inStock value is the boolean true.
Find a Specific Author
Finds book objects matching the exact author value.
Retrieve a Specific Nested Field
Selects the city value from the nested location object.
Select an Array Slice
In implementations supporting this slice syntax, selects the first two books: the elements at indexes 0 and 1. The ending index 2 is excluded.
JSONPath Tester vs. JavaScript Property Access
JSONPath and JavaScript can both be used to access data inside JSON-like structures, but they are designed for different purposes. JSONPath expresses queries over a document, whereas JavaScript lets you write application logic to access, filter, and transform data.
| Feature | JSONPath | JavaScript |
|---|---|---|
| Purpose | Selects values from a JSON document. | Accesses, processes, and transforms application data. |
| Root access | Uses $ to represent the document root. |
Uses a variable or object reference. |
| Property access | Uses selectors such as $.store.name. |
Uses access expressions such as data.store.name. |
| Select array items | Uses expressions such as $.items[*]. |
Uses loops, array methods, or other code. |
| Filter arrays | Uses supported filter expressions such as [?(@.active)]. |
Commonly uses the filter() method. |
| Recursive search | Can use $..name where supported. |
Usually requires explicit traversal logic. |
| Best suited for | Testing and expressing data-selection queries. | Application behavior, complex transformations, and custom processing. |
Which should you use? JSONPath is convenient for testing and extracting values from structured documents. JavaScript is more appropriate when you need custom logic, calculations, data modification, or application-specific behavior.
Common JSONPath Errors and How to Fix Them
An expression can fail or return unexpected results because of a syntax issue, an incorrect property name, a wrong array index, or a mismatch between the query and the JSON structure.
Incorrect Property Name
Property names must match the JSON data, including capitalization.
Correction: Use the exact key author if that is how it appears in the JSON.
Wrong Array Index
JSON arrays use zero-based indexing, so an index of 0 means the first element.
Correction: Check the array length. The sample book array has only three elements, at indexes 0, 1, and 2.
Incorrect Root Selector
Absolute JSONPath expressions commonly start with the root selector.
Correction: Use $.store.book[*].title when your evaluator expects an absolute path.
Incorrect Filter Syntax
Filters commonly use [?(...)] and refer to the current item with @.
Correction: Check the parentheses, brackets, property name, and comparison operator.
Invalid Input JSON
A query cannot be evaluated correctly if the input document cannot be parsed as JSON.
Correction: Check quotation marks, commas, colons, and matching braces or brackets before testing the expression.
Unsupported Operator
Not every JSONPath implementation supports the same extensions or filter operators.
Correction: Check which operators your evaluator supports and try a simpler expression to isolate the issue.
What to Check When No Results Appear
- Verify that the JSON input is valid and contains the expected data.
- Check the spelling and capitalization of every property name.
- Confirm that the path follows the correct nesting structure.
- Check array indexes and filter conditions.
- Try a simpler expression, such as
or.store, before adding more selectors. - Use recursive descent, such as
$..author, to look for a property at different nesting levels.
Common Uses of a JSONPath Tester
JSONPath queries are useful when you need to locate specific values in large or nested JSON documents without manually examining every property.
Test REST API Responses
Extract particular response fields, identifiers, status values, and nested records while developing or troubleshooting API integrations.
Inspect Webhook Payloads
Find event properties and nested values in JSON payloads produced by applications, automation tools, and external services.
Filter Arrays of Objects
Select records that match conditions such as a status flag, a numeric threshold, or an exact string value.
Debug Nested Data
Use property selectors and recursive descent to locate values deep inside a large document.
Prepare Automated Tests
Identify specific values from API responses or fixture data when checking the expected behavior of an integration.
Learn JSONPath Syntax
Experiment with root selectors, wildcards, array indexes, slices, and filters using a sample JSON document.
Is This JSONPath Tester Private?
This JSONPath tester is intended to evaluate JSON data and expressions directly in your browser rather than uploading the input to a remote evaluation service. Browser-based processing can be convenient when inspecting development payloads and test documents.
Even when data is processed locally, consider the security of your device, browser extensions, and surrounding workflow. Avoid entering passwords, access tokens, personal customer information, or production secrets unless you have verified that the environment is appropriate for handling them.
Security reminder: JSONPath evaluation does not encrypt your JSON, remove sensitive values, or make data safe to share. Review any results before copying, exporting, or sending them elsewhere.
Frequently Asked Questions
What is JSONPath?
JSONPath is a query language for selecting values from a JSON document. It uses expressions to navigate objects, access array elements, find nested properties, and filter data according to supported conditions.
What is a JSONPath tester?
A JSONPath tester evaluates an expression against a JSON document and displays the matching results. Depending on the tool, it may also show match counts, matched paths, and formatted output.
How do I write a JSONPath expression?
Start with fortherootofthedocument,thenaddpropertyselectors,arrayindexes,wildcards,recursivedescent,orsupportedfilterexpressions.Forexample,.store.book[*].author selects every author in the book array.
What does the dollar sign mean in JSONPath?
The dollar sign $ represents the root node of the JSON document. It is commonly used at the beginning of an absolute JSONPath expression.
What does $..name mean?
The expression $..name uses recursive descent to search through descendants for properties named name. It can find matching properties at different nesting levels when supported by the evaluator.
What does @ mean in JSONPath?
In common filter syntax, @ represents the current node being evaluated. For example, $.items[?(@.price < 10)] checks the price of each candidate item.
Can JSONPath select values from arrays?
Yes. JSONPath can select particular elements with indexes, select multiple children with wildcards, and query portions of arrays with supported slices and filters.
How do I filter JSONPath results by a condition?
Use a filter expression supported by your evaluator, such as $.store.book[?(@.price < 10)]. The condition is evaluated against candidate elements, and matching items are returned.
Why does my JSONPath expression return no results?
Check whether the property exists, matches the correct capitalization, and appears at the expected nesting level. Also review array indexes, filter conditions, and implementation-specific syntax support. Try a simpler query first.
Does JSONPath modify my JSON data?
JSONPath is used to query and select data rather than modify the original JSON document. The returned values represent matches for the expression; editing the original document is a separate operation.
Is JSONPath the same as JavaScript dot notation?
No. JavaScript dot notation accesses properties on an object, while JSONPath provides a query syntax for selecting values across JSON structures. JSONPath supports patterns such as wildcards and recursive descent that generally require additional logic in JavaScript.
Does every JSONPath tester support the same syntax?
No. Implementations may differ in support for filters, negative indexes, unions, slices, logical operators, and other extensions. Use expressions supported by the particular evaluator you are testing.
Can JSONPath search nested objects?
Yes. Child selectors navigate a known path through nested objects, while recursive descent can search for matching properties at multiple depths.
Is this JSONPath tester suitable for API debugging?
Yes. JSONPath can help isolate selected fields from API responses, inspect nested objects, and filter arrays while troubleshooting integration behavior.