EN
My tools

XPath Tester (XPath 1.0 for XML and HTML)

Test XPath 1.0 expressions against XML or HTML in your browser: matched nodes, counts, strings, numbers and booleans, with namespace prefixes.

Prefixes declared in the document (xmlns:p="…") are added automatically.
My tools →
Advertisement

XPath selects parts of an XML or HTML document with path expressions such as //book[price > 10]/title. Scrapers, XSLT, Selenium and Playwright locators, SOAP clients and many config tools rely on it, and a typo silently selects nothing. Paste a document, type an expression and see exactly which nodes match — or the number, string or boolean an expression like count() returns — using your browser's own XPath 1.0 engine.

How to use this tool

  1. Paste XML or HTML and choose how to parse it.
  2. Type an XPath expression and press Calculate.
  3. For namespaced XML, prefixes declared in the document are bound for you; add others as prefix=URI lines.
  4. Read the matches (text content, type, name and serialized markup) or the computed value.

Formula

/ child · // descendant · @ attribute · [predicate] · text() · count() sum() string() contains() starts-with() position() last()

This is XPath 1.0, the version browsers implement (XPath 2.0/3.1 functions such as matches() or lower-case() are not available). Node-sets are listed in document order. An unprefixed name never matches an element in a default namespace (xmlns="…") — bind a prefix to that URI and use it, as XPath 1.0 requires.

Example

In the sample catalog, //book[price > 10]/title matches 2 nodes: "XML Developer's Guide" (44.95) and "Maeve Ascendant" (12.50). count(//book) returns the number 3, count(//book[@lang]) returns 2 (two books have a lang attribute), and //book/@id lists bk101, bk102 and bk103.

Frequently asked questions

Why does my expression return nothing on an RSS, Atom or SOAP document?

Those documents use a default namespace. XPath 1.0 has no default namespace, so //entry matches nothing; bind a prefix such as atom=http://www.w3.org/2005/Atom and write //atom:entry.

Can I use XPath 2.0 or 3.1 functions?

No — browsers only implement XPath 1.0. Most expressions people need (paths, predicates, contains(), count()) are 1.0.

Why do HTML results contain tags I did not write?

HTML is parsed like a web page, so the parser adds implied elements such as <html>, <body> and <tbody>, exactly as the DOM in a browser would have them.

Is my document uploaded?

No. Everything runs in your browser.

Why does it not update while I type?

The browser's XPath engine cannot be stopped once it starts, and an expression with nested // inside predicates, such as //*[count(//*) > 0], can take minutes on a large document. So it runs only when you press Calculate.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). XPath Tester (XPath 1.0 for XML and HTML). https://kakao.mobile/tools/xpath-tester/

MLA

“XPath Tester (XPath 1.0 for XML and HTML).” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/xpath-tester/.

Advertisement