CSS Minifier
Paste CSS and get a smaller version with comments and unneeded whitespace removed. Values, selectors and strings are not rewritten, and the size change is shown in bytes so you can judge the saving yourself.
Free, no sign-up. Your code stays in your browser.
Your CSS
Paste CSS and press Minify.
How to
Minify CSS in three steps
Paste your stylesheet
Drop in a whole file or part of one. Comments and indentation are fine; they are what gets removed.
Decide about licence comments
Keep the comments that start with /*! if your licence needs them to stay, or remove everything.
Minify, copy or download
Press Minify and check the bytes before and after, then copy the result or save it as a .css file.
What this minifier does and does not do
- It removes comments, collapses whitespace, and removes spaces only where CSS does not need them. It also drops the last semicolon in each block.
- It does not shorten colours, numbers or shorthand properties, merge rules or reorder anything, so the result is smaller but not as small as a full optimizer would make it.
- Spaces that change meaning are kept, for example the one in a descendant selector such as .a :hover and the ones around + and – inside calc().
- Keep your original file. Minified CSS is hard to read, so edit the source and minify again.
FAQ
CSS minifier questions
Is my CSS uploaded anywhere?
No. The minifier is code that runs in your browser and the page makes no network request with your stylesheet.
Could minifying break my styles?
The minifier only removes whitespace and comments that CSS does not need, and it keeps spaces that carry meaning. It still pays to test the page after you swap in the minified file, particularly if the sheet contains unusual or very new syntax.
How much smaller will my file get?
It depends on how much whitespace and how many comments the file has, so there is no typical figure. The page shows the size before and after in bytes. A stylesheet that is already minified will barely change.
Does it compress files the way gzip does?
No. Minifying and gzip or Brotli compression are separate steps. A server usually compresses CSS on top of the minified file, which makes it smaller again.
Why are my colours and numbers unchanged?
To keep the result safe, this tool does not rewrite values. Changing #ffffff to #fff or 0.5 to .5 is possible but each change needs care, so it is left out here.
Can I minify JavaScript here?
No. There is no JavaScript minifier on this site. A safe one needs a full parser, and a simple one can break code.