XPath Tester / Playground
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
Private by design: your data never leaves your device.
Output
Paste a document and an XPath expression.
Good to know
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.
Typical searches include XPath tester, XPath online, and XPath playground. 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.
How it works
How it works
Step by step
Features
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
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
More tools
XML to JSON
Convert XML files or pasted XML text to JSON directly in the browser.
JSONPath Query Evaluator
Run RFC 9535 JSONPath queries locally against JSON and show normalized paths.
RegEx Tester
Test JavaScript regular expressions locally, inspect matches and capture groups, and preview replacements.
JSON Formatter
Validate, format, minify, analyze, and inspect JSON as a tree locally.