Skip to main content
Z

XPath Tester — Evaluate XPath Against XML & HTML Live

Test XPath expressions against XML or HTML using your browser's native XPath engine. Live results table.

Free No signup Client-side Privacy friendly Updated

Examples: //book/title, //*[class=""="x"], //@href, count(//book)

matches

# Node Value
No matches.

How to use

  1. 1 Paste XML or HTML source in the textarea.
  2. 2 Pick the document mode — XML for strict parsing, HTML for lenient tag soup.
  3. 3 Type an XPath expression. Results update live.
  4. 4 Copy the matching node list as TSV.

Why use this tool

  • Uses your browser's native <code class="font-mono text-xs">document.evaluate</code> — no external dependency.
  • Switch between XML and HTML parsers in one click.
  • Live results — no submit button.
  • Pure client-side — your document stays in your browser.

Frequently asked questions

Which XPath version is supported?

XPath 1.0 — the version implemented natively by browsers. XPath 2.0/3.0 features (regex, sequences, types) are not supported.

Why does my HTML query return nothing?

HTML mode wraps your fragment in <code class="font-mono">html/body</code>. Adjust expressions accordingly (e.g. <code class="font-mono">//body//div</code>).

Related tools?

<a class="text-brand-600 hover:underline" href="/jsonpath-tester">JSONPath Tester</a> for JSON queries; <a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a> to clean XML first.

What is XPath Tester?

An XPath Tester is a tool that evaluates XPath expressions against XML or HTML and displays the matching nodes. It uses the browser's native XPath engine to run queries live and presents the results in a table. Because it operates entirely client-side, the XML or HTML being queried is never uploaded, letting developers test and refine XPath expressions privately.

Features

Native XPath engine

Uses the browser's built-in document.evaluate, so results match how a real DOM resolves the expression.

Node results table

Lists each matching node with its value, updating live as you edit the expression.

100% private

XML/HTML is queried on the device and never uploaded.

Example

Input

XML: <books><book>A</book><book>B</book></books>   ·   XPath: //book[1]/text()

Output

A

Common use cases

  1. 1

    Build scraping selectors

    Develop and verify the XPath a scraper or automation will use against sample HTML.

  2. 2

    Query XML documents

    Pull elements or attributes out of a config, feed, or SOAP response.

  3. 3

    Test predicates

    Check that a predicate like [@id='x'] or [1] selects the node you expect.

Summary

Zerethon's XPath tester evaluates XPath expressions against XML or HTML using the browser's native XPath engine (document.evaluate), displaying the matching nodes in a live results table. Because it runs entirely client-side, the markup being queried is never uploaded, letting you test and refine expressions privately.

Category
Developer
Pricing
Free
Privacy
Browser-based
Signup
Not required

References

Privacy

Your data never leaves your browser unless explicitly stated. XPath Tester runs entirely client-side — no server upload, no logging, no tracking of your input.

Learn the basics

Related tools

Build, share, and grow on Zerethon Social

Free signup. Earn points, collect achievements, and connect with creators worldwide.

Try Zerethon free