JSONPath / XPath Tester
Write a path expression and see every match — nothing leaves your browser.
JSONPath & XPath syntax, side by side
| Meaning | JSONPath | XPath |
|---|---|---|
| Root | $ | / |
| Child property | .key / ['key'] | /a/b |
| Any depth | ..key | //b |
| Wildcard — every child | * | * |
| Index / several indices | [n] / [n,m] | [n] (1-indexed) |
| Slice | [start:end:step] | no direct equivalent |
| Attribute | not applicable | @attr |
| Filter / predicate | [?(@.x < 10)] | [x < 10] |
| Functions | not applicable | text(), count(...), string(...) |
JSONPath filters combine conditions with && / ||, e.g. [?(@.price < 10 && @.inStock)].
Why Use This Tester?
- One tool for both JSONPath and XPath
- Every match shown with its exact path and value
- Filters, wildcards and recursive descent all work
- Instant results as you type
- Runs entirely in your browser
Features & Supported Capabilities
- JSONPath: property access, wildcards, slices, filters
- XPath: the browser's own native engine — full XPath 1.0
- Reports invalid JSON, invalid XML, or a bad expression clearly
- Copy every matched path in one click
- Nothing is ever uploaded — parsing happens locally
About the JSONPath and XPath tester
JSONPath and XPath are query languages for pulling values out of JSON and XML. This free online tester lets you write an expression, run it against your document and see every match together with its path and value, so you can get the query right before putting it into code, a test or a config.
It runs entirely in your browser, so the data you paste is not uploaded. Use the JSON formatter or XML formatter to tidy a document first, or the JSON viewer and XML viewer to browse it as a tree and copy a node's path.
Frequently Asked Questions
Everything you might want to know about the online JSONPath / XPath tester.
==, !=, >, >=, <
and <=, combined with && and ||, for
example [?(@.price < 10 && @.category=='fiction')].
document.evaluate(), so the full function library is available.
$.store.book[1].title, for XML an XPath like
/store/book[2]/title — so you can paste it straight into your own code.
@, for example
//book/@category to get every book's category attribute.
$..author finds every author key at any depth,
however deeply nested — the JSONPath equivalent of XPath's //author.
Copy Paths to copy every match's path, one per line, to your
clipboard.