CSS Unused Code Finder

Find unused CSS selectors: load a page or paste HTML and CSS, see which rules match nothing, and download a cleaned, smaller stylesheet.

Tool

Was this tool useful?

About this tool

About CSS Unused Code Finder

Old themes and frameworks ship lots of CSS that a page never uses. Enter a page address (we load its HTML and stylesheets) or paste HTML from one or more pages and your CSS. The finder tests every selector against the HTML, lists the ones that match nothing with their line numbers, shows how much of the file they take, and creates a cleaned CSS file. Classes added later by JavaScript can be protected with a keep-list.

How it works

CSS is parsed with CSSTree; each selector (with :hover, ::before and similar states removed) is tested with querySelector on the HTML. A rule is removed only when all its selectors are unused.

Example

A Bootstrap theme page often uses less than 20% of bootstrap.css – the cleaned file can be 80% smaller.

How to use this tool

  1. Enter a page address, or paste HTML and CSS.
  2. Add classes your JavaScript adds (e.g. active, open, is-*).
  3. Review the unused selectors and download the cleaned CSS.

Frequently asked questions

Is it safe to delete everything it finds?

Only if the HTML you gave covers all pages and states. Test the cleaned CSS on a copy first – content loaded later or by JavaScript is not seen.

Does it check @keyframes and fonts?

@font-face and @keyframes are kept as they are.

Can I export the result?

Yes – download the result as CSV (opens in Excel and Google Sheets).

Does the CSS Unused Code Finder send my data to a server?

Only when you enter a web address: our server loads that public page and its stylesheets with strict safety checks and does not keep them. CSS you paste is checked in your browser.