Developer ToolsCode ValidatorsFree Tool

XPath Tester

Test and debug XPath expressions against any XML document instantly in your browser.

How to Use XPath Tester
  1. 1Paste your XML document into the 'XML Document' field. Make sure it is well-formed — every opening tag must have a matching closing tag.
  2. 2Type your XPath expression into the 'XPath Expression' field. For example, enter //book/title to select all <title> elements inside <book> elements.
  3. 3Use predicates to filter results — e.g. //book[@category='fiction'] selects only books where the category attribute equals 'fiction'.
  4. 4Click the Evaluate button. Matched nodes are listed below, numbered, and shown as full XML snippets.
  5. 5Click the Copy icon next to any result to copy that node's content to your clipboard.
  6. 6Click the reset button (↺) to clear all fields and start a new query.
Frequently Asked Questions

XPath (XML Path Language) is a query language for navigating and selecting nodes in an XML document. It lets you pinpoint elements, attributes, or text values using path expressions like //book/title or //item[@id='1'].

This tool uses your browser's built-in XPath 1.0 engine, which supports axes (//), predicates ([]), wildcards (*), and core functions like text(), count(), contains(), and @attribute.

Any valid XPath 1.0 expression — for example: //title (all title elements), //book[@category='fiction'] (books with a specific attribute), //price[text()>10] (price elements by value), or count(//item) (count matching nodes).

Check that your XML is well-formed (every tag is properly closed and nested), your expression path matches the actual element names (XPath is case-sensitive), and any namespace prefixes in your XML are accounted for.

Yes. All processing happens entirely in your browser using the built-in DOM and XPath APIs. No data is sent to any server.

Related Tools

Related Articles

More from Developer Tools