Free · No sign-up · Runs in your browser

CSS Selector Tester

Test a CSS selector against pasted HTML and inspect matching elements, text and attributes locally.

STEP 1

Start with your input

Edit the example or replace it with your own text.

STEP 2

Choose your options

These settings are optional. Keep the defaults to get started.

How to use CSS Selector Tester

  1. Paste the example or your own input.
  2. Choose the options that match your task.
  3. Run the tool, review the result, then copy or download it.

When to use CSS Selector Tester

Before writing a scraper or a browser assertion, test whether a selector matches the intended elements in a small HTML sample. Paste a fragment and enter a browser-supported CSS selector. The result includes the match count and a structured description of each matching element, with its tag, attributes and text content. Invalid selector syntax is reported as an error.

How to interpret the result

HTML is parsed in an inert template and is never inserted into the live page. Scripts do not run and referenced resources are not loaded. Browser parsing can repair malformed markup, so the tree can differ from the original string. Layout-dependent pseudo-classes, hover state, shadow DOM and external styles are not simulated. Matches are capped at one thousand to keep the result readable; narrow a broad selector before inspecting a larger sample.

Example input

<ul><li class="active" data-id="1">Ada</li><li>Grace</li></ul>

What should I check before using the output?

HTML is parsed in an inert template and is never inserted into the live page.

Is input uploaded?

Processing takes place in your browser. This tool does not send your input or selected files to a conversion API.

Related tools and guides

Browse all developer tools