- 1element
<title>The Pragmatic Programmer</title> - 2element
<title>Le Petit Prince</title>
About XPath Tester & Evaluator for XML / HTML
XPath is the query language for navigating XML and HTML documents — selecting elements, attributes, and text by path, predicate, or function. It powers web scraping, XSLT transforms, SOAP responses, and config debugging, but a single mistyped predicate can silently return nothing, so testing against a real document is the fastest way to get an expression right.
This free XPath tester evaluates your expression against any XML document and lists every matched node — elements with their markup, attribute values, and text — plus the result of functions like count(). It supports XPath 1.0 with predicates and namespaces, and runs entirely in your browser: your document never leaves your device.
Features
- Live evaluation of XPath 1.0 expressions against XML
- Matched elements, attributes, and text shown as a numbered list
- Supports predicates, functions like count(), and namespaces
- Clear errors for malformed XML or invalid expressions; fully offline
How to use
- Paste your XML (or HTML) document into the left pane.
- Type an XPath expression in the bar, e.g. //book/title or //@id.
- Review the matched nodes on the right, with a live match count.
- Copy any matched node string straight to your clipboard.
Frequently asked questions
Which XPath version does this support?
It evaluates XPath 1.0, the version supported by browsers and most XML tooling. That covers paths, predicates ([@lang='en']), axes, and functions like count(), string(), and contains(). XPath 2.0/3.1-only features are not available.
Can I query HTML as well as XML?
The evaluator parses your input as XML, so well-formed XHTML works directly. Loose HTML (unclosed tags, bare attributes) may fail to parse — tidy it into well-formed markup first, or the tester will report the parse error.
How do I select an attribute or text instead of an element?
Use @name for attributes (//book/@id) and text() for text nodes (//title/text()). Element results show their full markup; attribute and text results show the value directly.
Is my document sent to a server?
No. Parsing and XPath evaluation happen entirely in your browser using a DOM-free engine, so nothing you paste ever leaves your device. The tool works offline.
Related tools
Everything runs locally in your browser — your input is never uploaded.