XPath Tester

Paste XML or HTML and an XPath expression and see every node it selects, with its text and attributes. Runs on your browser's own XPath engine.

Processed on your device. Files are not uploaded

How to test an XPath expression

  1. Paste your XML or HTML

    The document to search.

  2. Enter an XPath

    Such as //book[@lang='en']/title.

  3. Read the nodes

    A table lists every node selected, with its type, text and attributes.

    Counts, strings and true or false results are shown too.

When to use XPath Tester

You are writing a scraper or a test and want to try an XPath on real XML or HTML.

You need to see which nodes an expression selects, with their text and attributes.

Tips for a better XPath Tester result

Paste the document, type an expression such as //book[@lang='en']/title, and read the table of nodes.

Counts, strings and true or false results are shown as well as nodes.

XPath Tester: limits and what to check

XML must be well formed, with every tag closed, one root element and quoted attributes.

It supports XPath 1.0, which is what browsers provide.

About XPath Tester

Run an XPath expression on XML or HTML and see every node it selects, with its type, text and attributes. It uses your browser's own XPath engine. Counts, strings and true or false results are shown too.

FAQs

Why does my XML fail to load?

XML must be well formed: every tag closed, one root element and quoted attributes. The error tells you what is wrong.

Which XPath version is supported?

XPath 1.0, which is what browsers provide.

Can I test CSS selectors?

Use CSS Selector Tester.

Related tools