Free Online XPath Tester
This tool evaluates an XPath 1.0 expression against pasted XML using the browser's DOMParser and document.evaluate, listing every matching node.
Your data is processed entirely in your browser and never sent to any server.
How to Use This Tool
- Paste well-formed XML into the input box.
- Enter an XPath expression such as //book/title.
- Matching nodes appear with their serialized markup or value.
- Fix any reported XML parse errors before querying.
- Adjust the expression until it selects exactly what you need.
What Is a XPath Tester?
XPath is a query language for navigating an XML document's node tree. A path like /root/child selects by position, // finds matching elements anywhere in the tree, @attr selects an attribute, and predicates in square brackets filter by condition. It is the standard way to address parts of XML and HTML, and it underpins much web scraping and config processing.
This tester runs entirely on the browser's built-in engine: DOMParser turns your text into a document and document.evaluate runs the expression. That engine implements XPath 1.0, which is very widely supported but lacks some functions added in XPath 2.0 and later. Results depend on the expression type — a node query returns matched elements, attributes, or text serialized for display, while a count() or string() expression returns the computed number, boolean, or string.
Malformed XML is caught and reported rather than silently returning nothing, which makes the tool useful for debugging both the document and the query. Test a selector here before using it in a scraper or an XSLT transform. Everything stays in your browser, so private XML never leaves the page.
Frequently Asked Questions
What is XPath?
Which XPath version runs?
What does it return?
Published by the WeGotEveryTool team. We build and test every tool in-house and update pages when the underlying spec, formula, or recommendation changes.
Reviewed: May 2026. Disclaimer: this tool is provided as-is for general informational use. For decisions with material consequences (medical, legal, financial, security) verify results against a qualified professional source.
Related Data Tools
Run a JSONPath expression against pasted JSON and see every matching value, useful for testing API queries.
Turn a JSON array of objects into a readable HTML table, with keys as columns and each object as a row.
Build a semantic HTML table from CSV or TSV with a thead header and optional styling classes, ready to copy.
View and explore CSV files in the browser. Sort columns, filter rows, and browse without uploading anything.
Convert CSV or TSV into a GitHub-flavored Markdown table with optional column alignment for READMEs and docs.