Skip to content
Run here 100% in your browser, no upload, no login

CSS Selector Tester

Paste HTML and a CSS selector, then see exactly which elements match, safely.

The fragment is parsed in an isolated container: script elements, on* handlers and remote URLs are ignored, so nothing runs and nothing is fetched.

How to use it

  1. Paste an HTML fragment into the first panel. A full document is not required, a few nested tags are enough.
  2. Type a CSS selector such as .card > p, ul li:nth-child(2) or a[href].
  3. Click Test selector. Every match is listed with its index, tag name, id, classes and the first 40 characters of its text.
  4. If the selector cannot be parsed, the browser's own error message is shown instead of an empty result, so a typo never looks like a zero-match answer.

The fragment is parsed inside a detached container that is never attached to the page. Script elements and inline event handlers are removed, and resource-bearing attributes such as src and href are blanked, so nothing executes and nothing is fetched. When something is stripped, the tool tells you exactly how much was removed.

Common use cases

Why it stays private

Everything happens in your browser's memory. Your markup is never uploaded, so internal templates and page fragments stay on your device.

FAQ

Q: Why did my img[src="photo.png"] selector stop matching? A: Resource attributes are blanked so the browser cannot fetch anything. The attribute is kept, so img[src] still matches, but selectors that compare the exact URL will not.

Q: Are scripts in my fragment executed? A: No. Script, iframe, object and embed elements are removed before parsing, and inline event handlers are stripped. The container is also never attached to the document.

Q: Does it support the full selector syntax? A: Whatever your browser supports. The tool calls the same querySelectorAll your page code uses, so results match what the browser will do at runtime.

Your data stays on this device

CSS Selector Tester runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.