Unused CSS Finder
Find & Remove Unused CSS Online

Paste your HTML and CSS to instantly find unused selectors, calculate byte savings, and download a cleaned stylesheet. Client-side — no upload, no login.

Selector analysis Byte savings Clean CSS output No server needed

Unused CSS Finder

Paste your HTML in the left pane and CSS in the right pane. Click Analyze to see which CSS selectors are used and which are safe to remove.

// Unused CSS Finder — Paste HTML + CSS to analyze
HTML 0 chars
CSS 0 chars
Ctrl+Enter to run
0 Unused selectors
0 Used selectors
0 B Bytes saved
0% CSS reduced by
Reduction
0%

How to Find and Remove Unused CSS

Multiple approaches to identifying and removing unused CSS — from this tool for quick checks to automated pipeline solutions.

Using this tool

Paste your HTML source in the left pane and your CSS in the right pane. Click Analyze. The tool parses every selector from the CSS and checks whether it could match any element in the HTML. Unused selectors are listed with their approximate byte cost. Download the cleaned CSS directly or copy it to clipboard.

For best results: include the full page HTML (not a partial), and paste all CSS files concatenated into the CSS pane. The tool handles class selectors (.btn), ID selectors (#nav), element selectors (h1), and attribute selectors ([type="text"]).

Chrome DevTools Coverage

For live sites: open Chrome DevTools (F12) → click the three-dot menu → More Tools → Coverage. Click the record button and interact with your page. The Coverage tab shows the exact % of each CSS file that was used during your session. This is the most accurate method since it measures actual runtime usage including dynamic JavaScript-injected classes.

PurgeCSS (automated)

PurgeCSS is a Node.js tool that analyzes HTML, JS, and template files to remove unused CSS from your build output. It integrates with Webpack, Vite, and PostCSS. Ideal for production builds — eliminates unused CSS from Tailwind, Bootstrap, or any CSS framework before deployment. Run as part of your CI/CD pipeline for zero-unused-CSS production builds.

What this tool can't detect

No static analyzer can catch: CSS classes added dynamically by JavaScript at runtime (e.g., classList.add('active')), pseudo-classes like :hover and :focus (considered used if the base selector matches), @keyframes used by animations, or media-query-scoped styles that only apply at certain screen widths. Always manually review results before deleting CSS in production.

Unused CSS Tools Comparison

The main tools for finding and removing unused CSS — choose based on your workflow.

ToolTypeDetects JS ClassesRequires InstallCostBest For
This ToolBrowser (paste)❌ Static onlyNoFreeQuick single-page check
Chrome CoverageBrowser DevTools✅ Yes (runtime)No (built-in)FreeAccurate live analysis
PurgeCSSCLI / Build plugin✅ With confignpm installFreeProduction builds, CI/CD
UnusedCSS.comSaaS (URL crawl)✅ Yes (rendering)NoFree/PaidFull site audits
VS Code ExtensionIDE⚠️ PartialVS CodeFreeReal-time editing
LighthouseBrowser audit✅ Yes (rendering)No (built-in)FreeCore Web Vitals audit

CSS Optimization Tools

Unused CSS Finder – FAQ

What is unused CSS?+
Unused CSS refers to CSS rules and selectors loaded by the browser but never applied to any element on the page. A selector like .promo-banner is unused if no element with that class exists in the HTML. Unused CSS increases CSS file size, adds render-blocking weight, and slows First Contentful Paint. Typical production sites have 40-60% unused CSS from frameworks like Bootstrap or Tailwind when not purged.
How does this unused CSS finder work?+
The tool parses the CSS input to extract every selector using a regex-based CSS parser. It then checks each selector against the HTML to see if any matching elements exist. For class selectors (.btn), it checks for class="btn" in the HTML. For ID selectors (#nav), it checks for id="nav". For element selectors (h1), it checks for the tag. Selectors with no match in the HTML are flagged as unused. The clean CSS output contains only the rules whose selectors matched.
Does unused CSS affect Core Web Vitals?+
Yes. Unused CSS increases the size of render-blocking resources. CSS is render-blocking by default — the browser won't render the page until all CSS is downloaded and parsed. Larger CSS files mean longer First Contentful Paint (FCP) and Largest Contentful Paint (LCP). Google Lighthouse includes "Reduce unused CSS" as a performance opportunity, and it directly impacts LCP which is a Core Web Vitals metric. Removing unused CSS from a typical site can save 50-150KB and meaningfully improve FCP.
Will removing detected unused CSS break my site?+
Static analysis can miss CSS that's added dynamically by JavaScript (classList.add, third-party scripts, state classes). Always: (1) test on a staging environment first, (2) keep CSS for interactive states (:hover, :focus, :active), (3) keep CSS for dynamically added classes your JS uses, and (4) back up your original CSS before replacing it. For maximum safety, use Chrome DevTools Coverage tab after interacting with all page states — it catches runtime-added classes that static analysis misses.
What is the best tool to remove unused CSS in production?+
For production builds: PurgeCSS integrated into your Vite or Webpack build pipeline is the gold standard. It scans all HTML, JS, and template files to find CSS classes in use and removes everything else. For Tailwind CSS specifically, Tailwind's built-in JIT engine eliminates unused styles automatically. For quick one-off checks of a single page: this tool or Chrome DevTools Coverage. For full site audits: UnusedCSS.com crawls your live site and renders it to detect runtime classes.