JSONPath / XPath Tester

Write a path expression and see every match — nothing leaves your browser.

JSON Document 0 B
Matches 0 matches

JSONPath & XPath syntax, side by side

JSONPath and XPath syntax compared
MeaningJSONPathXPath
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
Attributenot applicable@attr
Filter / predicate[?(@.x < 10)][x < 10]
Functionsnot applicabletext(), 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.

They solve the same problem — pulling specific values out of a document — for two different formats. JSONPath queries JSON, XPath queries XML, and their syntax is deliberately similar: both use path segments, wildcards and filters.
==, !=, >, >=, < and <=, combined with && and ||, for example [?(@.price < 10 && @.category=='fiction')].
Yes — XPath queries run on your browser's own built-in XPath 1.0 engine, the same one behind document.evaluate(), so the full function library is available.
No. Both the JSON/XML parsing and the query evaluation run entirely in your browser. Nothing you paste here is ever uploaded, stored, or logged.
It's the exact, absolute path to that specific match — for JSON a JSONPath like $.store.book[1].title, for XML an XPath like /store/book[2]/title — so you can paste it straight into your own code.
Yes, prefix the attribute name with @, for example //book/@category to get every book's category attribute.
Yes. $..author finds every author key at any depth, however deeply nested — the JSONPath equivalent of XPath's //author.
Most often the document itself doesn't parse — check it's valid JSON or well-formed XML first. Otherwise, double-check bracket and quote pairing in the expression.
Yes, click Copy Paths to copy every match's path, one per line, to your clipboard.