CSS · 4 min read
How to Minify CSS
Reduce stylesheet size without changing the way your site looks.
Published 2 November 2026
Minifying CSS removes characters that browsers do not need: comments, extra spaces and line breaks. The result looks unreadable, but it behaves the same way and downloads faster.
What is safe to remove?
Whitespace around selectors, braces and property values can usually be removed. Comments can be removed unless they are license headers marked with an exclamation mark. Spaces inside strings and URLs must be preserved.
Before and after
/* before */
.button {
color: #ffffff;
padding: 12px;
}
/* after */
.button{color:#ffffff;padding:12px}Where minification fits
Minify as a late build step. Keep your source CSS readable in version control, then publish the compressed version. If you change the source later, regenerate the minified file rather than editing it by hand.
Avoiding surprises
- Check that strings and data URLs survive unchanged.
- Keep important license comments.
- Test the page after deploying the minified stylesheet.
- Do not remove whitespace inside calc() expressions.
The Tipde CSS Minifier is designed with these cases in mind and runs locally, so you can test stylesheets before shipping them.