XPath Tester for XML and HTML

Evaluate XPath expressions against XML or HTML in your browser and see matching elements, attributes and values.

About XPath Tester for XML and HTML

Test XPath 1.0 expressions against XML or HTML using the browser's built-in XPath engine. See matching elements, attribute values, text nodes, or the result of functions such as count() and string().

Use it to build selectors for web scraping, Selenium and Playwright tests, XSLT, or XML config files. Choose HTML mode for web pages, which tolerates unclosed tags.

How to use it

  1. Paste XML or HTML and choose the matching mode.
  2. Type an XPath expression such as //book[@lang='en']/title.
  3. Read the matches below.

Questions

Is my data uploaded?

No. Everything runs in your browser; nothing you paste or open is sent to a server.

Why does my XML with a default namespace return nothing?

XPath 1.0 needs a prefix for namespaced elements. Use a test such as //*[local-name()='book'] to match regardless of namespace.

Which XPath version is supported?

XPath 1.0, the version built into browsers.

More Developer & Code tools

Home · All Tools · Blog