XPath Tester
Paste an XML document, add namespace prefixes if it uses them, and evaluate an XPath expression. Node results are listed with their location and XML as plain text; string, number and boolean results are shown directly.
1. XML & expression
XPath 1.0Namespaces
No namespace prefixes. Add them if your XML uses namespaces.
| Prefix | Namespace URI | Remove |
|---|
2. Result
Shown as textDOCTYPE, entity declarations and processing instructions are blocked. Nothing in the XML is loaded or run.
About XPath Tester
XPath Tester evaluates XPath 1.0 expressions against an XML document using the browser’s built-in engine. It shows node sets with their location and XML, and string, number and boolean results directly. Namespace prefixes can be mapped by hand or added from the document, and DOCTYPE, entity declarations and processing instructions are blocked before parsing.
XPath is used in XSLT, test automation, scraping, configuration and many XML-based formats. Testing expressions against real XML shows quickly what they select and why namespaced queries return nothing.
Step by step
- Paste an XML document.
- If it uses namespaces, add prefixes or press Add from document.
- Type an XPath expression.
- Press Evaluate and review the result type and values.
- Copy or download the report.
What it offers
- Native XPath 1.0 evaluation with all standard functions
- Node-set, string, number and boolean results
- Editable prefix-to-namespace mapping
- Automatic detection of namespaces declared in the document
- DOCTYPE, entities and processing instructions blocked
- Escaped, text-only display of matched XML
Tips for best results
- Map a prefix for the default namespace and use it on every step.
- Prefer specific paths over // on large documents.
- Use count() or boolean() to check conditions quickly.
- Test expressions on documents with missing optional elements.
Why people use it
Accurate
Uses the browser’s own XPath engine.
Namespace-aware
Prefixes mapped in one place.
Safe
Risky XML features are blocked.
Private
XML never leaves your browser.
Common questions
This runs entirely in your browser
No file or text you enter here is uploaded. Encoding and decoding happen on your device using native browser APIs — close the tab and nothing remains on a server.