Compress your CSS for faster websites
/* Comment */
body {
background-color: blue;
color: white;
}
h1 {
background–color: purple;
}body{background-color:blue;color:white}h1{background–color:purple}CSS minification removes unnecessary characters from your stylesheets – spaces, comments, line breaks, and extra semicolons – without changing how the browser interprets them. This results in smaller file sizes and faster loading times.
Smaller CSS files mean fewer bytes to download, especially critical for mobile users or slow connections.
A smaller stylesheet can download faster. That does not by itself guarantee a higher search ranking.
Keep your source code readable with indentation and comments, then minify for production – best of both worlds.
Smaller files mean less data transfer, saving money for high-traffic websites.
Enter your unminified CSS code in the left textarea. It minifies in real-time as you type or paste.
Our tool removes whitespace, comments, and extra semicolons, producing a single-line output.
Click the copy button to grab the minified CSS and use it in your production website.
Paste this rule:
/* keep? */
body {
margin: 0px;
color: #ffffff;
}
h1 { color: #ffffff !important; }The minifier removes the block comment, including a /*! license */ comment, deletes the line breaks, drops the space before !important, shortens #ffffff to #fff, and turns 0px into 0. The readable result is one line similar to body{margin:0;color:#fff}h1{color:#fff!important}.
It does not rename classes, merge duplicate selectors, or check that the CSS is valid. A broken rule is still a broken rule after the spaces are gone. Keep the commented source in version control and minify a copy for the page you publish.