XPath Tester / Playground
Runs locally in your browser. Nothing leaves your device.Test XPath 1.0 in the browser and XPath 3.1 locally against XML or HTML documents.
XPath settings
XPath 1.0 and XPath 3.1 have different type, comparison, and function semantics. HTML is only available in XPath 1.0 mode.
Input
Output
Paste a document and an XPath expression.
How it works
- 1
Paste the document or open a file
Paste XML or HTML or open an XML, HTML, or TXT file up to 100 MB.
- 2
Choose the engine, document mode, and namespaces
Choose XPath 1.0 or 3.1, XML or HTML, and enter needed namespace prefixes.
- 3
Test the expression and export matches
Enter the XPath expression and export the matches as JSON, values, or paths.
Good to know
The XPath tester evaluates XPath expressions against XML or HTML documents directly in your browser, with two selectable engines: XPath 1.0 via the native browser engine or XPath 3.1 via FontoXPath, loaded separately in a worker. The HTML document mode normalizes input like the browser DOM and is only available in XPath 1.0 mode.
Custom namespace prefixes can be specified as prefix=URI lines, since the XML default namespace doesn't automatically apply to unprefixed names in XPath 1.0. Important: XPath 1.0 and XPath 3.1 have different type, comparison, and function semantics, and namespaces are a common cause of empty results.
Typical use cases
Develop an XPath selector for an HTML page
Choose the HTML document mode with XPath 1.0 to test a selector against browser-like normalized HTML, for example for web scraping.
Test modern XPath 3.1 functions against an XML document
Switch to the XPath 3.1 engine to check expressions with modern type semantics and extended functions against an XML document.
Tips for better results
Explicitly map namespace prefixes
If queries return empty, enter the matching namespace prefixes as prefix=URI, since unprefixed names in XPath 1.0 don't automatically use the default namespace.
Choose the engine matching the target system
Test with XPath 1.0 if the target system uses an older engine like the native browser XPath implementation, and with 3.1 if modern functions are needed.
Features
Two XPath engines
XPath 1.0 via the native browser engine or XPath 3.1 via FontoXPath in a worker.
XML and HTML document modes
XML is strictly parsed, HTML is normalized into a DOM like in the browser (XPath 1.0 only).
Local processing
Your data never leaves your device; evaluation runs entirely in the browser.
Frequently asked questions
Why does my query return no matches?
Namespaces are a common cause — enter the matching prefixes, since unprefixed names in XPath 1.0 don't automatically use the default namespace.
Is my data uploaded?
No. Evaluation runs entirely locally in the browser.
More tools
Looking for another tool?
Every tool runs locally in your browser – no sign-up, no upload, and it works offline.