We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Test XPath expressions right in your browser and see matches instantly — great for web scraping, data collection, and front-end debugging.
One prefix mapping per line, in the format prefix=URI. Default namespaces must be referenced using a custom prefix in XPath.
Please enter content and an XPath expression to see results.
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
XPath selects nodes or computes values from a document tree. This tester evaluates an expression against HTML or XML text pasted into the page; it does not fetch a live website from a URL. The browser’s native XPath evaluator determines supported expressions, so a query intended for another XPath version or engine may behave differently.
In XML mode malformed XML produces a parse error. HTML mode parses input as HTML and may normalize or repair markup before evaluating. Results can be nodes, a string, number, or Boolean. Node results show count, kind, name, path, and value; scalar results show the computed value.
For example, with XML containing a book category attribute, //book/@category selects the attribute. count(//book) returns a number rather than a node list.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Select XML when the source is XML and should be checked for well-formedness, or HTML when testing markup as an HTML document.
Enter document text and the XPath expression. A sample XML document and expression can be restored as a starting point.
For namespaced XML, provide prefix-to-URI mappings, one per line, using colon or equals. Use that prefix in the expression.
Review result type and match count. For nodes, inspect value and path; for scalar output, read the displayed value. Copy controls are available.
If there are no matches, check parse mode, element names, nesting, namespaces, and whether HTML parsing normalized the source.
Use cases
See how the tool fits into real work and everyday tasks.
Test a selector against sample XML before using it in a data workflow. Node paths and values help explain a match.
Paste representative markup and check whether an expression selects intended elements. The tester does not load a dynamic page.
Compare node selection with a count, string, or Boolean expression to understand the difference between selected nodes and computed values.
Q&A
Find concise answers to common questions and confusing cases.
It uses the browser’s native XPath API. Do not assume XPath 2.0 or 3.0 support; verify in the target engine.
No. Paste HTML or XML source. The tester does not retrieve remote pages or execute their scripts.
The modes parse input into different document models. HTML parsing may normalize markup; XML mode reports malformed input.
Add a prefix and namespace URI in the mapping field, then use that prefix in the expression. The source prefix may differ if both resolve to the same URI.
Notes
Review scope, result limitations, and important precautions before use.
The result tests pasted text using the current browser’s XPath behavior. It does not prove that a scraper, server library, extension, or another browser behaves identically or has access to the same live DOM. HTML parsing can change the tree; XML must be well formed. Verify important expressions in the environment that will run them.
Related
Discover related tools, collections, and available API capabilities.