Analyzers · Free CSS tool

Unused CSS Finder

Free · no sign-up Live preview · copy or download the CSS

Paste your HTML and your CSS, and every selector is tested against the actual document — rules that match nothing are listed for deletion, with an honest account of what a static check can and can't know.

Settings

Results appear here.
Generated CSS — updates live

The CSS you need to build this yourself

Understand the output, not just copy it — these lessons on our learning path teach exactly what this tool automates:

  1. CSS Analyzer & Stylesheet StatsAnalyzers
  2. Duplicate CSS RemoverCode Quality
  3. CSS Comment RemoverCode Quality
  4. CSS Minifier & FormatterDeveloper Tools
  5. CSS Validator & Syntax CheckerValidators & Checkers

How it works

Each selector is stripped of its pseudo parts (a rule for .btn:hover is 'used' if .btn exists) and run through querySelector against your parsed HTML — the same matching engine the browser styles with, so there are no heuristics, just real matches.

The stated limits are the important part: JS-injected classes, other pages, and CMS content aren't in your paste. That's why serious dead-code removal pairs a static check like this with runtime coverage (DevTools' Coverage panel) across real user flows.

Run the code — try it yourself

Two of these four rules are dead against this HTML. Predict which, then verify with the tool above.

exercise.html — editable

Frequently asked questions

Can I paste a whole page's HTML?

Yes — full documents parse fine; the head is simply unlikely to match visual selectors.

Why is :root untestable?

Stripping pseudo-classes leaves nothing to query. Rules like :root { --vars } are effectively always used — keep them.

Will deleting flagged rules break my site?

Only if the selector matches somewhere you didn't paste — hence 'candidates, not verdicts'. Delete in a commit you can revert, and re-test.

Keep going

Dead CSS is the cheapest performance win available — pure deletion. Measure the reclaimed bytes in the Gzip Estimator afterward.

CSSmatic is a non-profit project, made by developers for developers.