Remove unused CSS

Clean CSS from URLs, HTML, and stylesheets.

Paste a website or your own code. The tool shows used rules, unused rules, savings, and the cleaned output.

Source URL or code
Check Selectors against DOM
Result Clean CSS

The HTML page is loaded and its linked CSS files are checked against this exact page.

FAQ

Questions about the CSS Cleaner

A quick guide to what the tool does, how the analysis works, and when extra HTML helps.

What is this tool for?

Unused CSS Cleaner helps you find unused CSS for a specific website URL. It is useful for faster load times, smaller stylesheets, better web performance, and cleaner frontend delivery.

How does this tool work?

You enter a website URL. The tool loads the rendered HTML, detects linked CSS files and inline styles, then checks CSS selectors against this exact HTML page.

Can I check my own HTML and CSS code?

Yes. In HTML & CSS Code mode, you can paste your own HTML and CSS directly. This is useful for templates, components, landing pages, or local snippets without a public URL.

Are all CSS files detected automatically?

Yes. Stylesheets from link rel="stylesheet" and style tags are read from the loaded HTML page. Relative CSS paths are resolved automatically.

Can I check a direct CSS file?

A direct CSS URL can be loaded. To detect unused rules, the tool still needs HTML as the comparison target. Use a website URL, add extra HTML, or use HTML & CSS Code mode.

When do I need extra HTML?

Extra HTML helps when important classes from PHP templates, includes, modals, navigation, or dynamic areas are not visible in the loaded URL HTML.

Can I analyze a PHP file directly?

No. The tool analyzes the final HTML that the browser receives. You can add HTML from PHP files, includes, or templates so important CSS classes are included.

What does Include JavaScript classes do?

This option scans inline JavaScript and linked JavaScript files for typical class names. Found classes are protected so JavaScript states are not removed from the CSS by accident.

Why can a safelist be useful?

Some classes are only added by JavaScript, sliders, cookie banners, menus, or states such as is-active, open, and show. With the safelist, you can keep those selectors even if they are not visible in the loaded HTML.

What do protected and unused selectors mean?

Protected selectors stay in the output because they are listed in the safelist or detected from JavaScript. Unused selectors were not found in the checked HTML and were removed from the cleaned CSS output.

Why is an analysis log helpful?

The analysis log shows which URL, CSS files, inline styles, extra HTML, safelist, and options were used. This keeps the data source clear and explains why the result was created.

Are inline styles in HTML considered?

Style tags in the head are analyzed as CSS sources. Style attributes directly on HTML elements are counted in the analysis log, but they are not output as removable CSS rules because they belong to the HTML element.

What does CSS quality check?

The CSS quality check shows common findings such as empty rules, duplicate properties, !important, @import, unnecessary zero units, display conflicts, or offset values without a matching position. These hints do not change CSS automatically.

When should I remove comments?

Removing comments is optional. When the option is off, CSS comments stay in the output and are not counted as hidden savings. If you want smaller files, you can remove comments deliberately.

Can sorting change the CSS cascade?

Yes, it can. Sorting CSS by selectors makes the output easier to scan, but it can change order for equally specific rules. Use this option only when you review the cleaned CSS afterwards.

Why does a risk warning appear?

The warning appears when a very large amount of CSS was removed. Check dynamic areas, extra HTML, and the safelist before using the file in production.

What should I check before production use?

Always test the cleaned CSS in a staging environment first, clear browser, server, and plugin caches, and check important states such as menus, modals, sliders, forms, login areas, and mobile views. Dynamic or hidden classes can still be missed even with a safelist.

Can I save the result?

Yes. The cleaned CSS can be copied or downloaded. URL analyses use a matching file name. Minifying and removing comments remain deliberate options.