Free XPath tester — evaluate XPath expressions against your XML in the browser

Results

Run an expression to see matching nodes.

🧭 XPath Tester — Free Online Tool

Evaluate XPath expressions against XML online, free. XPath is the W3C query language for navigating XML — it selects nodes, attributes and values by path, with predicates and functions. This tester parses your XML with the browser's native DOM and evaluates an XPath expression against it, listing every matching node, attribute, string, number or boolean so you can verify a query before using it in code, XSLT, or a scraper.

🚀 Why use this XPath Tester tool?

Evaluation uses the browser's built-in XML parser and XPath engine (document.evaluate), so it follows the W3C XPath 1.0 spec exactly — and your XML never leaves the page. 100% free, no registration, and complete privacy — everything runs locally in your browser, so your data never touches a server.

Key Features

🎯Live evaluation

Paste XML, type an XPath expression and instantly see every node, attribute or value it selects.

🧱Native XPath engine

Uses the browser's document.evaluate, so results match the W3C XPath 1.0 behaviour used across tools.

🏷️All result types

Handles node-sets, attributes (//@id), strings, numbers (count(...)) and booleans, each labelled by type.

🔒100% private

Your XML is parsed and queried locally; nothing is uploaded, so it is safe for sensitive documents.

Popular Use Cases

Scraping & parsing

  • Confirm an XPath before coding it
  • Target a node by attribute
  • Extract text() from elements

XSLT & config

  • Test match patterns for XSLT
  • Validate XPath in a pipeline
  • Debug an empty selection

Learning

  • Practise predicates [@attr='x']
  • Compare // vs / navigation
  • Try count() and other functions

What It Handles

Selects

  • Elements & attributes
  • text() nodes
  • Predicates [ ... ]

Returns

  • Node-sets
  • Strings & numbers
  • Booleans

Privacy

  • Native DOM parser
  • No network calls
  • Runs offline

Sources & References

Frequently Asked Questions

What is XPath?

XPath (XML Path Language, a W3C standard) is a query language for selecting parts of an XML document. Paths like /bookstore/book navigate from the root, // searches anywhere, @ selects attributes, and predicates in square brackets filter by condition — for example //book[@category='tech']/title selects the titles of tech books.

Which XPath version does this tester use?

It uses the browser's native document.evaluate, which implements W3C XPath 1.0 — the same engine browsers use internally. That covers node selection, attributes, predicates and core functions like count(), text() and contains(). XPath 2.0/3.1-only features are not available in browsers.

How do I select an attribute or a text value?

Use @ for attributes — //book/@category returns the category attributes — and text() for text nodes — //title/text() returns the title strings. To count matches, wrap a node-set in count(), e.g. count(//book), which this tool reports as a number result.

Why does my XPath return no matches?

The most common cause is XML namespaces: if your document declares a default namespace (xmlns="..."), unprefixed XPath steps won't match. Other causes are a typo in an element name (XPath is case-sensitive), using / where you need //, or an XML parse error — which this tool reports above the results.

Is this a free alternative to FreeFormatter's XPath tester?

Yes. It evaluates XPath for free with no signup and runs entirely in your browser using the native XPath engine, so your XML is never uploaded — covering the same node, attribute and value queries as hosted testers.

Is my XML sent anywhere?

No. Parsing and evaluation happen in your browser via the built-in DOM; the document is never transmitted or stored, so it's safe to test against confidential XML.

🎓 Pro Tips

  • Tip 1: If a query unexpectedly returns nothing, check for a default xmlns on the root — namespaced documents need namespace-aware paths, which browser XPath 1.0 handles only with prefixes.
  • Tip 2: Use // for 'anywhere in the document' and / for 'direct child' — mixing them up is the most common reason a path over- or under-matches.
  • Tip 3: Wrap a node-set in count() to quickly check how many nodes a path matches before extracting their values.