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.

Instant results 100% private No signup needed

How to Use This Tool

  1. Paste well-formed XML into the input box.
  2. Enter an XPath expression such as //book/title.
  3. Matching nodes appear with their serialized markup or value.
  4. Fix any reported XML parse errors before querying.
  5. 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?
A query language for XML that navigates the node tree. /root/child selects by path, //element finds anywhere, and @attr selects attributes.
Which XPath version runs?
The browser's built-in document.evaluate engine, which implements XPath 1.0 — widely supported, though it lacks some XPath 2.0+ functions.
What does it return?
Matched elements, attributes, or text nodes, each shown with its serialized markup or value so you can verify a selector before scraping.

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

You Might Also Like