{{ summaryFigure }}
{{ summaryDetail }}
{{ statusBadge }} {{ evaluatorBadge }} {{ outputModeLabel }} {{ analysis.totalMatches.toLocaleString() }} path{{ analysis.totalMatches === 1 ? '' : 's' }} Showing {{ analysis.displayMatches.length.toLocaleString() }} of {{ analysis.totalMatches.toLocaleString() }}
{{ selectorSegments.length }} seg
JSONPath tester inputs
Paste one JSON object or array, or browse/drop a JSON file.
{{ sourceMetaLabel }}
{{ sourceActionHint }}
Run selectors such as $.store.book[*].title, $..price, or $.store.book[?(@.price < 10)].
Change the primary output without changing the match ledger or JSON export.
Choose how filter expressions and library fallback are handled.
Keep large query results readable while preserving the full match count.
matches
Use 0 to 8 spaces for JSON output formatting.
spaces
Choose the language shown in the Code Snippet result tab.
{{ primaryOutput || emptyOutputText }}
Index Path Pointer Type Depth Preview Copy
{{ row.index }} {{ row.path }} {{ row.pointer }} {{ row.type }} {{ row.depth }} {{ row.preview }}
No match shape to chart
The expression is valid, but it returned no nodes for the current JSON source.
{{ codeSnippet }}
Selector Use Example Support Copy
{{ row.selector }} {{ row.use }} {{ row.example }} {{ row.support }}
{{ diagnosticJson }}
Customize
Advanced
:

Introduction:

Large JSON documents are easy to search badly. API responses, event logs, configuration exports, and test fixtures often repeat the same member names at several depths, mix optional fields with required ones, and hide the value that matters inside an array item or nested object. JSONPath is a compact query language for asking for those values without hand-scanning the whole tree.

A JSONPath expression starts at the root value and moves through objects, arrays, descendants, indexes, slices, wildcards, unions, or filters. The answer is a nodelist: zero or more JSON nodes selected from the original value. Zero nodes can be a correct result when the branch is absent or the filter condition is false, so an empty result should not be confused with invalid JSON or invalid syntax.

JSONPath is useful in practical work where the same question has to be answered repeatedly against similar payloads. A monitoring rule may need every failed job code, a unit test may assert the first item price, and a migration script may collect every nested identifier before rewriting records. The selector keeps that question readable, while the matched paths show exactly which branch supplied each answer.

Root
The whole JSON value, written as $ before child or descendant selectors.
Segment
One step in the expression, such as a member name, array index, wildcard, slice, or filter.
Nodelist
The ordered set of nodes returned after an expression runs, including the possibility of no nodes.

The important tradeoff is precision versus reach. A direct path such as $.store.book[0].title is easier to review but depends on one exact array position. A recursive expression such as $..title finds more candidates but may also catch titles from branches you did not intend to include. Filters add another layer of usefulness, but they are also where library behavior and safety settings most often matter.

JSON values selected by a JSONPath expression into matched values, paths, and pointers.

JSONPath also sits next to, not inside, schema validation. A selector can show that a value exists in one sample or that a filter finds matching items, but it does not prove that every future payload will contain the same branch, type, or array length. Use JSON Schema or a similar contract check when the question is whether a payload is valid.

Portability is the other caution. Simple member and index selectors are easy to move between environments, while filters, unions, slices, recursive descent, and extensions are where examples copied from one library can surprise another. For production tests, alerts, or data migrations, the expression text is only half the evidence. Matched values and their exact paths should be checked against representative payloads.

How to Use This Tool:

Start with a payload that represents the JSON shape you expect to handle, then confirm both the match count and the exact paths before copying an expression into other code.

  1. Paste one JSON value into JSON source, choose Browse JSON, drop a .json or .txt file, or load Sample. File loading accepts JSON or text files up to 2 MB.
  2. Enter a JSONPath expression that starts with $. The quick inserts add common fragments such as .*, ..price, [*], [0:2], and [?()].
  3. Choose Evaluator policy. Use JSONPath Plus safe filters for filter expressions, No script filters when filter evaluation should be disabled, or Basic local selectors only for root, child, index, wildcard, recursive descent, slice, and union checks without filters.
  4. Set Result artifact to the format you need first. Values as lines is good for a quick copy, Path = value lines keeps context beside each value, and Paths only, JSON Pointers only, or JSON array preserve more structured evidence.
  5. Open Advanced when broad selectors need a Display cap, JSON output needs a different JSON indent, or the Code snippet should be shown for JavaScript, Python, Java, Go, or PHP.
  6. Use the summary status as the first recovery cue. JSON issue means the pasted value did not parse, Expression issue means the expression failed under the selected evaluator policy, and No matches means evaluation succeeded but returned an empty nodelist.
  7. Check Match Ledger and Match Shape before reusing the selector. The ledger keeps path, pointer, type, depth, and value preview together, while the chart makes unexpectedly mixed value types easier to spot.

Interpreting Results:

Matched means the expression selected one or more nodes from the current JSON value. The summary count is the total number of matches returned by the evaluator; the display cap only limits how many rows and output lines are shown.

No matches deserves a shape check before it is treated as a problem. It may mean the key is absent, a filter condition is false for every item, an array index is outside the current array, or the expression was written for a different version of the payload.

Matched Values is the copy-focused result. Match Ledger is better for review because it ties each value to a JSONPath-style path, a JSON Pointer, its type, its depth, and a preview. Match Shape is useful when a selector should return one type of value but instead returns a mix such as strings, numbers, and objects.

Do not treat a successful match as proof that the expression is portable. Copy the same representative payload into the target JSONPath library or language, run the expression there, and compare values and paths before relying on it in tests, alerts, or data processing.

Technical Details:

JSON values form a tree. Objects contain named members, arrays contain zero-based positions, and primitive values such as strings, numbers, booleans, and null sit at the leaves. JSONPath applies selectors to a current nodelist and produces the next nodelist until the expression is complete.

A selector does not edit the JSON value. It either selects children, scans descendants, keeps array positions, combines named or indexed choices, or applies a filter condition to candidate nodes. Empty results are part of the model because any selector step can produce no nodes.

Transformation Core:

JSONPath evaluation stages and review checks
Stage Rule Review check
Parse JSON The input must parse as one JSON value before a selector can run. Fix JSON issue messages before trusting any result.
Start at root $ represents the whole JSON value and begins the expression. An expression that does not start at the root is rejected.
Apply selectors Each segment consumes the current nodelist and returns the next nodelist. An empty nodelist is valid when no candidate node satisfies a segment.
Apply evaluator policy Filter expressions run only when the selected policy allows them; basic mode rejects filters. Use the evaluator badge and Syntax Notes when results differ from another library.
Record evidence Matched nodes are represented as values, paths, JSON Pointers, value types, depth, and chart rows. Use Match Ledger for reproducible review notes.

JSON Pointer evidence has a different job from JSONPath evidence. A pointer identifies a specific location with slash-separated reference tokens, such as /store/book/0/title. A pointer escapes a literal tilde as ~0 and a literal slash inside a key as ~1, which makes it useful when a later system expects pointer syntax rather than the selector that originally found the node.

Selector Support Map:

JSONPath selector meanings and support notes
Selector Meaning Support note
$ Root value. Required starting point for expressions.
.key or ['key'] Named object member. Bracket form handles spaces, punctuation, and keys that cannot be written with dot notation.
[0] or [-1] Array item by zero-based index, with negative indexes counted from the end where supported. Indexes outside the array return no node.
[*] All children of an array or object. Broad wildcards can produce many rows, so use the display cap for inspection.
..price or ..* Recursive descent through descendants. Useful for inspection, but easy to overmatch in nested payloads.
[0:2] Array slice from the start index up to, but not including, the end index. Basic mode supports simple positive-step slices.
[0,2] Union of selected indexes or keys. Order and duplicate handling can vary across evaluators.
[?(@.price < 10)] Filter children by a condition. Requires the safe-filter evaluator; no-script and basic modes reject filter evaluation.

Result Evidence:

JSONPath result fields and their interpretation
Result field Meaning How to verify it
Total matches Number of nodes returned by the current expression. Compare the total with shown rows when Display cap is active.
Path JSONPath-style route to the matched node. Use it to see which branch produced the value.
Pointer JSON Pointer route to the same matched node. Use it when another tool or specification expects pointer syntax.
Type Matched value kind: string, number, object, array, boolean, or null. Check for mixed types before assuming a single output shape.
Depth How far the matched node sits below the root value. Unexpected depth can show that recursive descent reached more branches than intended.

Privacy Notes:

Pasted JSON and selected files are evaluated in the browser, and selected files are read into the text area rather than uploaded for matching. The page still loads the evaluator and chart code from public content delivery networks, and copied output, downloaded files, screenshots, or diagnostic JSON can contain source data. Use redacted examples when the payload includes secrets, customer records, tokens, or production identifiers.

Worked Examples:

Filter sample book titles by price

With the sample payload loaded, $.store.book[?(@.price < 10)].title under JSONPath Plus safe filters returns 2 matches. Matched Values shows the two title strings, and Match Ledger shows the book paths and JSON Pointer rows that produced them.

Find every price value before narrowing

The expression $..price searches through descendants and returns the book prices plus the bicycle price in the sample. If the purpose is to learn where prices appear, set Result artifact to Paths only first, then replace the broad recursive descent with a narrower branch once the paths are clear.

Keep a selector inside basic behavior

In Basic local selectors only, $.store.book[0:2].title uses child and slice behavior and returns the first two book titles. The same mode rejects [?()] filters, so an Expression issue is expected until the evaluator policy is changed.

Separate invalid JSON from empty results

A missing comma or closing brace produces JSON issue, and no match evidence should be used. A valid expression such as $.store.magazine[*].title can still produce No matches because the sample has no magazine branch.

Advanced Tips:

  • Use Path = value lines when reviewing a selector with teammates because the value and its source branch stay together.
  • Switch to JSON Pointers only when another validation or patching workflow expects slash-separated pointer locations instead of JSONPath routes.
  • Keep Display cap low while exploring broad selectors such as $..*, then raise it only when the total match count and shape chart look intentional.
  • Use Basic local selectors only to confirm that a query stays within root, child, index, wildcard, recursive, slice, and union behavior before moving it to a restricted environment.
  • Check Match Shape after filters or recursive descent. Mixed strings, numbers, objects, and arrays usually mean the selector is broader than the downstream code expects.
  • Set Code snippet to the target language for a starter pattern, then still rerun the expression in the actual project library before relying on it.

FAQ:

Does a match prove my JSON follows an API schema?

No. A match proves that the current JSON parsed and the expression selected nodes. Required fields, allowed types, business rules, and schema validation still need separate checks.

Why did a valid expression return no matches?

The expression ran but selected an empty nodelist. Check member spelling, array indexes, filter conditions, and whether the payload version actually contains the branch you queried.

Why do filters work in one mode and fail in another?

Filters require an evaluator policy that allows filter conditions. No script filters and Basic local selectors only reject [?()], while JSONPath Plus safe filters allows those expressions.

Will the code snippet behave the same in my project?

Treat the snippet as a starter example. Different JSONPath libraries can disagree on filters, unions, recursive descent details, and path formatting, so rerun the same payload in the target project and compare matched values.

Why show JSON Pointers as well as paths?

The path explains how the JSONPath evaluator reached a node, while the pointer gives a slash-separated location for the same node. Pointer output is useful when another system expects JSON Pointer syntax.

Why was my selected file rejected?

The file picker accepts JSON and text files only, and the browser-side reader rejects files larger than 2 MB. Paste a smaller fixture or reduce the file before testing the expression.

Glossary:

JSONPath
A selector syntax for finding nodes inside a JSON value.
Root value
The whole parsed JSON value, represented by $.
Segment
One part of an expression that selects child nodes, descendant nodes, array items, or filtered values.
Nodelist
The ordered set of JSON nodes returned by a selector step or full expression.
Filter expression
A condition inside [?()] that keeps only matching array or object children.
Recursive descent
A selector such as ..price that searches through descendants instead of one direct child level.
Slice
An array range selector such as [0:2].
JSON Pointer
A slash-separated route such as /store/book/0/title that identifies a specific JSON value.

References: