CSS Minifier
Shrink a CSS file by removing comments and unneeded whitespace, without changing what it does.
How to use the css minifier
- Paste your CSS into the input box.
- Click Minify.
- Copy or download the compact stylesheet.
Features
- Removes CSS comments
- Collapses whitespace around braces, colons and semicolons
- Copy or download as a .css file
What CSS minification changes
Minification removes comments and unnecessary spacing so a stylesheet transfers fewer bytes. It does not redesign the page or make slow selectors faster; its main benefit is reducing the amount of text sent to the browser.
Keep an unminified source file for maintenance and use the minified copy for deployment. If your CSS uses unusual syntax, generated code or build-tool placeholders, test the output in your site before replacing the production stylesheet.
If you deploy through a CDN, use versioned filenames or a cache-busting strategy when the minified stylesheet changes. That avoids browsers holding an older cached file after you publish an update.
Performance also depends on how much CSS the page actually uses. Removing unused framework rules can save more bytes than minifying a stylesheet that still contains large blocks of unnecessary code.
Frequently asked questions
Related tools
Minify after development, not during it
Minified CSS is harder to read and debug. Keep an editable source file in version control and use minification as a delivery step after the stylesheet works correctly.
- Test the minified output on the pages that depend on it.
- Keep source maps if your build process supports them.
- Do not assume a smaller file fixes render-blocking; delivery and critical CSS strategy still matter.
Related reading: What “runs in your browser” means for privacy