XPath Tester

Run XPath queries on HTML or XML and list matching elements, attributes and text.

Runs instantly in your browser — results update as you type.

How do I test an XPath expression?

Paste the HTML or XML, type the XPath and the results appear instantly — matching elements, attributes or text nodes, or a number, string or boolean for functions like count(//a). It uses your browser’s native XPath engine.

How to use the XPath Tester

    Frequently asked questions

    Which XPath version?

    XPath 1.0, the version built into all browsers and most scraping libraries.

    Why does my XML query return nothing?

    Elements in a default namespace need a prefix; use local-name(), e.g. //*[local-name()="item"].

    Is the document uploaded?

    No.