LocalExcelTool
Get started

XPath Tester

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

Runs in your browserNo account neededFree

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 it

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

How XPath Tester works under the hood

Developer tools here are deterministic byte and string transformations. The useful question is not whether they are fast, but whether the output can be verified against a reference.

  1. 1

    Encode the input

    Text is converted to UTF-8 bytes with TextEncoder; binary input is read as an ArrayBuffer.

  2. 2

    Apply the primitive

    Hashing and HMAC use Web Crypto (SHA-1/256/384/512); encoding, escaping and formatting are pure functions over the bytes or string.

  3. 3

    Format the output

    The result is rendered as lowercase hex, Base64, or the target syntax, with the exact same rules the specification defines.

  4. 4

    Compare and copy

    Output stays on the page so you can diff it against a reference implementation before using it.

  5. Processing pipeline

Hashing is not encryption

A SHA-256 digest is one-way: there is no key and no way back. It proves that two inputs are identical (or not), which is what integrity checks need. It does not hide a password — for that you need a slow, salted KDF such as Argon2id, which this site uses for account passwords.

What runs where

Every transformation in this category runs in the tab. No key, token or payload is sent to us; the site cannot see what you hashed or decoded. That also means there is no server-side undo — if you close the tab, the input is gone.

Limits worth knowing

JWT decoding shows the header and payload; it does not validate the signature unless you supply the key, and it never proves the issuer is trustworthy. Regex-based tools can degrade badly on pathological input, so input size is capped. Very large payloads are also capped to keep the tab responsive.

Verify it yourself

Compare the output against a reference before you ship it.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

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