About the CSS Minifier tool
Stylesheets grow quickly: comments explaining sections, generous indentation, one property per line and trailing semicolons. None of that matters to the browser, but it all has to be downloaded before the page can paint, because CSS blocks rendering. Minifying CSS is one of the simplest performance wins you can make without touching a build pipeline.
Paste a stylesheet and this CSS minifier removes comments, collapses whitespace around braces, semicolons and commas, removes it after colons, and drops the last semicolon before each closing brace. Quoted strings such as content values and font names are copied exactly, so "New: " keeps its double space. If your file starts with a /*! … */ comment, the common convention for licence notices, you can keep it at the top of the output.
The result appears as you type, together with the original size, the minified size, the percentage saved and the gzipped size of both. The minifier does not rewrite colours, merge rules or reorder selectors, so the output behaves exactly like your original stylesheet. Nothing is uploaded; all processing happens in your browser.
How to use CSS Minifier
- Paste CSS into “CSS input”, or click “Open file” to load a .css file.
- Leave “Keep /*! license */ comments” on if your stylesheet has a licence header you must preserve.
- Watch the size tiles update with the bytes and percentage saved.
- Click “Copy” or “Download” to get the minified .min.css file.
Features
Comment and whitespace removal
Strips every comment and all spacing the browser does not need.
Strings preserved
Quoted values in content, url() and font-family keep their exact characters.
License comments kept
Optional switch keeps /*! … */ notices required by many open-source licences.
Behaviour-preserving
No selector merging or value rewriting, so the cascade and specificity stay identical.
Gzip comparison
Shows the compressed size before and after so you know the real transfer saving.
When to use it
- Minify a theme stylesheet before uploading it to WordPress or Shopify.
- Compress critical CSS before inlining it in the <head> of a page.
- Shrink a small project’s CSS without installing a bundler.
- Prepare CSS for an HTML email where every kilobyte counts.
Frequently asked questions
Is minified CSS still valid?
Yes. Only comments and whitespace that the CSS grammar ignores are removed, so browsers read the minified file exactly like the original.
Can I turn minified CSS back into readable code?
Yes. Paste it into the CSS Formatter on this site to re-indent it. Removed comments cannot be restored, so keep your original source file.
Does this tool merge duplicate rules or shorten colours?
No. It deliberately avoids structural optimisations so it can never change which rule wins. Tools like cssnano or Lightning CSS can do those extra optimisations in a build pipeline.
What is a /*! comment?
A comment starting with /*! is a convention meaning “keep this when minifying”, usually used for licence and copyright notices. The switch keeps them at the top of the output.