XPath Tester
Evaluate XPath 1.0 expressions against XML data in your browser.
XML Input
XPath Expression
All books
English books
All titles
First book
All prices
Book count
Expensive books
XPath Tester — Evaluate XPath Expressions Online
XPath (XML Path Language)is a query language for selecting nodes from an XML document. This tool uses the browser's built-in document.evaluate()to evaluate XPath 1.0 expressions natively — no server required.
Common XPath Syntax
//element— Select all elements at any depth/root/child— Select direct child from rootelement[@attr='value']— Filter by attribute valueelement[position()]— Select by position (e.g.[1])element/text()— Select text content of elementcount(//element)— Count matching elementselement[child > value]— Filter by child element value
Result node types
- element — An XML element node (shown with outer XML)
- attribute — An attribute node (shown as
name="value") - text — A text node (shown as plain text)
- value — A scalar result from functions like
count()