Find a JSONPath or Test an Expression
JSONPath is a query language for selecting values from a JSON document. Use the RomitJSON JSONPath Finder and Validator in either of two ways: search for text in keys and primitive values to discover their paths, or enter a JSONPath expression and run it against your data. Results show the matching value and its path, so you can see exactly what a query selects.
Paste JSON or open a local .json file, then run a query or find a key or value. The page reports malformed JSON separately from an invalid expression. A valid expression that selects nothing is reported as a valid query with no matches.
How to Use the JSONPath Finder
- Paste JSON into the data field, select Open JSON to choose a file, or use Load sample.
- To test a query, enter an expression in the JSONPath field and select Validate & Run or Run. Press Ctrl+Enter while in the expression field to run it.
- To find a path without writing an expression, enter part of a key or a primitive value in Find paths by key or value, then select Find.
- Read each result’s path and value. If a query has no matches, check the expression and the actual structure and values in the JSON.
JSONPath Examples
Given a document with a store object and a book array, these expressions select different parts of the data:
| Expression | What it selects |
|---|---|
$ | The complete JSON document |
$.store.book[0].title | The title in the first book object (array indexes start at 0) |
$.store.book[*].title | The title from every book in the array |
$..price | Values under a price key at any depth |
$.store.book[?(@.price < 10)].title | Titles of books whose price is below 10 |
The first character, $, refers to the root of the JSON document. Dot notation follows ordinary property names; brackets select array indexes, quoted property names, or groups of matches. The wildcard * selects all children at that level, while recursive descent .. searches deeper in the document. A filter such as [?(@.price < 10)] tests each candidate item against a condition.
Find Paths Without Writing a Query
Use Find paths by key or value when you know a word or value but are unsure where it appears. The search is case-insensitive and matches part of an object key or a primitive value such as a string, number, Boolean, or null. It returns each matching location as a JSONPath and displays the corresponding value. For example, searching for email can reveal paths such as $.users[2].email.
This search is different from running a JSONPath expression: it finds text in the document, while an expression can select data by its structure or filter conditions. The page displays up to 500 results for either workflow; additional matches are counted but omitted from the list.
JSONPath Errors and Empty Results
A query error and a query with no matches mean different things. An invalid expression has syntax the JSONPath engine cannot parse. A valid expression with no matches is well-formed but does not select any value in the current JSON. Check names and letter case, array indexes, nesting, and filter conditions before changing the expression.
The JSON document must also be valid JSON. JSON requires double quotes around strings and property names and does not allow trailing commas or comments. If the page reports an invalid JSON error, use the JSON Validator to inspect the document syntax first.
Which JSONPath Syntax Does This Tool Use?
This page evaluates queries with JSONPath-Plus, including common selectors, wildcards, recursive descent, unions, and filters. JSONPath implementations can differ in their supported extensions and edge cases, so test an expression in the same runtime that will use it in production. The JSONPath-Plus documentation describes this evaluator. The IETF’s RFC 9535 defines a standard JSONPath query language; do not assume every implementation supports identical extensions.
Input Size and Privacy
JSON input can be up to 10 MiB. The page parses the document and evaluates searches in your browser; it does not send your JSON or query to RomitJSON. It loads the JSONPath library from esm.sh, so your browser needs an internet connection to retrieve that code. The page displays up to 500 matches, with a note when more results were found. Avoid entering secrets or confidential data into online tools unless their handling fits your requirements.
Frequently Asked Questions
What does the dollar sign mean in a JSONPath?
$ identifies the root of the JSON document. For example, $.user.name follows the user property from the root, then selects its name property.
Can I find a JSON path without knowing JSONPath syntax?
Yes. Search for a key or primitive value in Find paths by key or value. The tool returns matching paths without requiring you to write a query.
Why does a valid JSONPath return no results?
The expression may refer to a key, index, or value that is not present in the current document, or its filter may exclude every item. No matches do not necessarily mean that the expression is invalid.
Does this tool validate JSON syntax?
It checks that the JSON can be parsed before running a query. For a dedicated syntax check and error details, use the JSON Validator.
How many results can I see?
The page displays up to 500 result rows. If a query or search finds more, it tells you how many additional results were omitted.
Related JSON Tools
Use the JSON Viewer to browse nested JSON as a tree, the JSON Validator to check syntax, or the JSON Schema Validator to compare data against required fields, types, and other schema rules.