About the CSS Minifier
The CSS Minifier removes comments, spaces, line breaks and other unnecessary characters from your stylesheet, producing a smaller file that downloads and parses faster. Smaller CSS improves page speed, which helps both user experience and search rankings, especially for visitors on mobile networks.
How to Use the CSS Minifier
- Paste your CSS into the input box.
- Click Minify.
- Compare the original and minified sizes.
- Copy the result into a
.min.cssfile and link it in production.
What Minification Removes
Comments, indentation, line breaks, spaces around { } : ; and the last semicolon in each rule. The browser reads the minified file exactly as it reads the original, so your design does not change. Typical savings are 20–40% before compression.
Keep the Original Source
Always edit the readable version of your stylesheet and generate the minified file from it. Many projects keep site.css for development and site.min.css for production. In ASP.NET Core, the <environment> tag helper can load the right file in each environment.
Other Ways to Speed Up CSS
Remove unused rules (many sites ship large frameworks but use a small part), enable gzip or Brotli compression on the server, set long cache headers with a version query string, and inline only the small amount of CSS needed to render the top of the page.
Frequently Asked Questions
Will minifying break my CSS?
No. Minification only removes characters that have no effect. If something breaks, the original CSS probably had a syntax error such as a missing brace.
Can I un-minify CSS?
Indentation can be restored with a formatter, but comments that were removed cannot be recovered, so keep your original file.
Is minification still needed with gzip?
Yes. They work together: minify first, then the server compresses the smaller file even further.
Can I minify SCSS or LESS?
Compile SCSS or LESS to plain CSS first, then minify the output.