XPath / CSS Selector Tester
Test XPath expressions and CSS selectors against HTML.
About this tool
Test XPath expressions and CSS selectors against HTML. Turn opaque strings from network traces, devtools, or SEO audits into structured output you can act on.
Paste the HTML document or fragment you want to query. Enter an XPath expression or CSS selector. Example — Select article titles: try `HTML: <h2 class="title">Ship notes</h2> selector: //h2[@class='title']` and expect something like `Ship notes`.
Runs against a browser DOM — some XML namespaces and XPath 2.0 features are unavailable. See also: JSONPath Tester, Regex Tester, and Open Graph Preview. Runs in your browser — nothing you paste gets uploaded.
How to use
- Paste the HTML document or fragment you want to query.
- Enter an XPath expression or CSS selector.
- Run the query and inspect matched nodes or text content.
- Tighten the selector until it uniquely targets the elements you care about.
Example
Select article titles
Input
HTML: <h2 class="title">Ship notes</h2> selector: //h2[@class='title']
Output
Ship notes
Limitations
- Runs against a browser DOM — some XML namespaces and XPath 2.0 features are unavailable.
- Malformed HTML is repaired by the parser, which can shift structure before matching.
- Does not execute against a live site; paste static markup.
Related guides
1Related tools
3Frequently asked questions
What does the XPath / CSS Selector Tester do?
Test XPath expressions and CSS selectors against HTML. Runs in your browser — no install, no account.
How do I use the XPath / CSS Selector Tester?
Paste the HTML document or fragment you want to query. Enter an XPath expression or CSS selector. Run the query and inspect matched nodes or text content. Tighten the selector until it uniquely targets the elements you care about.
Is the XPath / CSS Selector Tester free?
Yes. No signup, no usage limits, no paywall.
Does the XPath / CSS Selector Tester upload my data?
No. Processing happens locally in JavaScript. Your input is not uploaded, stored, or logged.
What are the limitations of the XPath / CSS Selector Tester?
Runs against a browser DOM — some XML namespaces and XPath 2.0 features are unavailable. Malformed HTML is repaired by the parser, which can shift structure before matching. Does not execute against a live site; paste static markup.