A CSS minifier removes comments, line breaks and unneeded spaces from a stylesheet so the file is smaller and loads faster. Paste your CSS and this tool returns the minified version with the size before, the size after and the percentage saved. Selectors, values and their order are not changed.
How to use the CSS Minifier
- Paste your CSSPaste a stylesheet or a few rules into the box.
- Check the resultThe minified CSS appears with the original size, new size and saving. Keep licence comments if you need them.
- Copy or downloadCopy the output or download style.min.css and link it in place of the original.
What the CSS minifier removes
This CSS minifier is deliberately conservative. It removes only characters that have no effect on how the stylesheet is read:
- Comments, except those starting with
/*!when the option is ticked. That form is the convention for licence notices. - Line breaks and indentation.
- Spaces around
{,},;and,, after:and(, and before)and!important. - The last semicolon in each rule, which is optional.
Just as important is what it leaves alone. Text inside quotes and url() is copied exactly. Spaces that carry meaning are kept: the spaces around + and - in calc(100% - 2rem), the space in a descendant selector such as .nav a, and the space before a colon in a :hover, which is not the same selector as a:hover.
It does not shorten colours, merge rules, drop units from zero values or reorder anything. Those rewrites save a few more bytes but can change behaviour in edge cases, and they make the output harder to compare with the source.
Why minify CSS
CSS blocks rendering: the browser will not paint a page until its stylesheets have arrived. Smaller files arrive sooner, especially on mobile connections. Readable, commented CSS usually shrinks by 15 to 35 percent from whitespace and comment removal alone.
A good workflow is to keep the readable stylesheet as your source, minify a copy for the live site, and never edit the minified file by hand. If you receive a minified stylesheet and need to read it, the CSS formatter turns it back into indented rules.
The minifier does not check that your CSS is valid. A missing brace in the input will still be missing in the output. Everything runs in your browser, so your code is not uploaded. To shrink the rest of a page, use the HTML minifier.
Frequently asked questions
What does a CSS minifier do?
It removes comments, line breaks and spaces that browsers ignore, plus the optional last semicolon in each rule. The styles work exactly the same and the file is smaller.
Will minified CSS behave differently?
No. This tool only removes whitespace and comments that have no meaning. Spaces that matter, such as those inside calc() or between selectors, are kept.
How much smaller will my CSS be?
It depends on how much whitespace and how many comments the file has. Indented, commented CSS commonly shrinks by 15 to 35 percent. The exact figure is shown for your input.
Can I get readable CSS back from minified CSS?
Yes, apart from the comments. Paste it into a CSS formatter to restore line breaks and indentation.
Is my stylesheet uploaded?
No. Minification happens locally in your browser.
Last updated 24 November 2026 by the TheTechFolk team.