CSS Selector Tester

Paste some HTML and a CSS selector and see which elements match, with their tags, classes and text.

Processed on your device. Files are not uploaded

How to test a CSS selector

  1. Paste your HTML

    The markup you want to test against.

  2. Enter a selector

    Any selector your browser understands.

  3. Read the matches

    A table lists every element that matches, the same as querySelectorAll.

When to use CSS Selector Tester

You want to check that a selector picks the elements you expect before you put it in a stylesheet or a script.

A selector matches nothing in production, and you want to debug it against the same HTML.

Tips for a better CSS Selector Tester result

Paste the HTML, type a selector, and read the table of matches with tags, classes and text.

Check the spelling of classes and ids and the parent and child order if nothing matches.

CSS Selector Tester: limits and what to check

It uses your browser's own selector engine, so the answer is the same as querySelectorAll in your code.

The HTML is parsed as a document and nothing in it is executed.

About CSS Selector Tester

Paste some HTML and a CSS selector and see which elements match. It uses your browser's own selector engine, so the answer is the same as querySelectorAll in your code.

FAQs

Does it run scripts in my HTML?

No. The HTML is parsed as a document and nothing in it is executed.

Why does it match nothing?

Check the spelling of classes and ids, and that your selector's parent and child order is the same as the HTML.

Can I check which selector wins?

Use CSS Specificity Calculator.

Related tools