Skip to content
100% local

XPath evaluator

Run an XPath 1.0 expression against pasted XML and see every match, its value and its path.

Input
Output

XPath evaluator

Paste an XML document, write an XPath 1.0 expression and this tool lists every node it matches — no need to wire up a script or open a debugger to check whether a selector actually finds what you think it does. It is built for the moment you are staring at an XSLT stylesheet, a scraping rule or an XQuery path that isn't returning what you expect, and need to test the expression against the real document in isolation.

The result type option controls how the expression's value is read: "Node-set" lists every matching element, attribute, text node or comment; "String", "Number" and "Boolean" cast the whole expression the way XPath's own string(), number() and boolean() functions would, which is how you check a comparison or a count() call in isolation. For node-set results, "Show matches as" switches between each match's text content and its full serialized XML, and you can number the matches or prefix each one with the resolved path (like /catalog/book[2]/title) that found it.

Supported syntax covers the subset people actually reach for: all the standard axes (child, descendant, descendant-or-self for //, parent, ancestor, self, following-sibling, preceding-sibling and attribute for @), wildcards, positional and boolean predicates, the union operator, and common functions — position(), last(), count(), name(), contains(), starts-with(), substring(), concat(), normalize-space() and the arithmetic and comparison operators. Variables, document(), key() and the namespace axis are not supported. Namespaced documents need a prefix bound to its URI under "Namespace bindings", one prefix=URI pair per line — or turn on "Ignore namespaces" to match by local name only, regardless of prefix.

Everything runs locally in your browser: the XML you paste and the expression you write against it are never uploaded anywhere, so it's safe to test against real API responses, config exports or production log excerpts. Invalid XML and invalid expressions are reported with what went wrong, not a blank result.

FAQ

Which parts of XPath 1.0 are supported?
All ten standard axes, name and node-type tests (including wildcards and text()/comment()/node()), positional and boolean predicates, the union (|) operator, arithmetic and comparison operators, and common functions like position(), last(), count(), name(), string(), contains(), starts-with(), substring(), concat(), normalize-space() and sum(). Variables ($x), document(), key() and the namespace axis are not supported.
Why does my expression match nothing on a namespaced document?
An unprefixed name test only matches elements with no namespace — the same rule real XPath processors follow. Bind the prefix your expression uses to the document's namespace URI under "Namespace bindings" (one prefix=URI per line), or turn on "Ignore namespaces" to match by local name alone.
What is the difference between the four result types?
"Node-set" lists the matched nodes themselves. "String", "Number" and "Boolean" instead cast the whole expression the way XPath's string(), number() and boolean() functions would — useful for checking a count() or a comparison expression directly instead of wrapping it in a predicate.
What happens with invalid XML or an invalid expression?
The tool reports which one failed and why — an unclosed tag or mismatched element for XML, an unexpected token or unbound namespace prefix for the expression — instead of returning an empty or misleading result.
Is my XML document uploaded anywhere?
No. Parsing and evaluation both run entirely in your browser — the document and the expression never leave your device.