LocalExcelTool
Get started

XPath Tester

Try XPath expressions against XML or HTML and see matches instantly.

What is XPath Tester

This XPath tester applies an XPath expression to XML or HTML and lists every matching node. Numeric, string and boolean results are supported too, using the browser's built-in XPath engine (document.evaluate). Parse and expression errors are reported with details. Nothing is uploaded.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

XPath 1.0, evaluated by the browser

Queries run through document.evaluate, which implements XPath 1.0. That means no XPath 2.0 or 3.1 functions — no matches(), no replace(), no for expressions, no sequences. A query copied from a schema tool or an XSLT 2.0 stylesheet will throw instead of returning results.

The context node is the parsed document, namespace handling is the standard browser one (HTML in the XHTML namespace), and the result can be a node set, a string, a number or a boolean depending on the expression. Testing an expression that returns a boolean in a node-result view shows nothing, which is not the same as failing.

HTML is not XML, and that changes the query

Browsers parse HTML leniently: unclosed tags are auto-closed, table content is reparented into tbody, and attribute names are lowercased. So //table/tr usually needs to be //table//tr, because the tr sits inside an implied tbody the source never wrote.

Class and id matching is exact and case-sensitive for values, and //div[@class="card"] fails on an element whose class is "card featured". Use contains(concat(' ', normalize-space(@class), ' '), ' card ') for a robust class test — verbose, but it is the only form that does not produce false negatives.

Where XPath still beats CSS selectors

Selecting by text content, walking to an ancestor, and indexing with positional predicates are all awkward or impossible in CSS. //button[normalize-space()='Save'] and //label[text()='Email']/following::input[1] express in one line what CSS cannot express at all.

For scraping, prefer stable structural anchors over text — labels and copy change with translations, structure changes less often. And check the expression against a second page of the same template before shipping it; an XPath that works on one product page and breaks on the next is the normal case.

How to use

  1. 1.Paste your XML/HTML
  2. 2.Enter an XPath expression
  3. 3.Run and review the matches

How this compares

There are three ways to do this conversion: in the browser (this page), through a server-side converter, or with a desktop app. The useful difference is not speed — it is where your file goes and how far the free tier actually reaches.

AspectThis toolUpload-based converters
Where the file is processedIn your browser, on this pageOn the vendor's servers, after an upload
Account requiredNoUsually — free tiers ask you to sign in before lifting a limit
Size you can process for freeNo size cap, no run limitA few files per hour, or a ~5–10 MB cap before a paywall
PriceFree. Pro is $9/month, and only buys larger files and AI featuresUsually a subscription — roughly $7–15/month as of November 2026
Works offlineYes, once the page has loadedNo
Time before work starts on a 20 MB fileImmediate — there is nothing to uploadDominated by the upload — about 16 s on a 10 Mbps uplink
What it cannot preserveChecks run against what the URL returns now, not against a stored snapshotThe same — the conversion is the same maths

Server-side converters are genuinely better at some things: very large files, sharing results with a team, keeping a conversion history, and automating batches from a script. For the case in front of you — one file, one format change, right now — they mostly add an upload wait and a sign-up form.

Frequently asked questions

Which result types are supported?

Node sets plus numeric results like count(), strings like string(), and boolean expressions.

Can I test HTML?

Yes — switch the mode to HTML and the input is parsed as text/html, so class-attribute queries work as well.

What this kind of conversion cannot keep

Developer tools here check what breaks silently: a missing canonical, a description over the length search engines display, a sitemap that returns 200 but lists dead URLs. Each result links to the exact line or URL, because a warning you cannot act on is noise.

More in Developer