CSS Selector Tester: Inert HTML Tree & Matching Nodes
Test supported CSS selectors against an inert local HTML fragment, inspect a text-only DOM tree and copy matches without scripts or resource loading.
Enabling local controls…
HTML and selector
Parses an isolated template fragment; input HTML is never inserted into the page. Scripts, styles, events, custom elements and external resources never execute or load. Inputs stay in page memory.
Limits: HTML 100,000 UTF-8 bytes; selector 500 bytes; 1,000 nodes; depth 32; 200 matches; report 200,000 bytes. Structural pseudo-classes (:nth-child, :not, :is, :has) use this browser’s native support. Pseudo-elements, dynamic pseudo-classes, :scope, escaped selectors and CSS comments outside quoted values are rejected.
DOM tree and node report
Enter input or load a sample, then test.
Text summaries stop at 160 characters; attributes remain in the report. Browsers repair HTML as a fragment; this does not validate a document. Queries do not cross nested templates, Shadow DOM or iframes. Zero matches do not prove selector validity, content safety or absence on a live page. This is not an HTML sanitizer.
How to use this tool
Paste an HTML fragment and supported selector, test and inspect matching nodes in the text tree. Invalid or oversized input clears the old report.
When not to use it
Fragment parsing can repair markup. Dynamic pseudo-classes, pseudo-elements, escaped selectors and :scope are outside this contract; this is not an HTML sanitizer.
Read the guide →