CSS Minifier

Shrink a stylesheet by removing comments and spare characters, and keep the readable version for editing.

CSS Minifier

Website Tools

Runs locally in your browser.

About the CSS Minifier

When authoring HTML documents, developers write CSS code with additional spaces, line breaks, and comments to make the code more readable and understandable for themselves and others. However, browsers do not read these symbols; they only recognize the standard notation described in the CSS specification. Therefore, all extra characters in CSS code only increase the file size and slow down the page loading.

This CSS Minifier will help you delete all extra whitespace, comments, and characters. It will compress your style sheets to their minimum size and improve the performance of your page.

Key Features of CSS Minifier

  • Intelligent CompressionRemove whitespace, extra line breaks, and comments from your CSS code to make it compact and production-ready.
  • Advanced OptimizationEnable the "Remove last semicolons" toggle to get rid of the last semicolons before the closing braces.
  • 100% Local ProcessingAll your design files stay private and secure. Nothing will be sent to third-party servers during processing.
  • Instant Export ToolsAfter processing, simply click the Copy button to save your CSS code on your computer or in your clipboard. Or, you can also download the code as .css.

How to Use CSS Minifier

  1. Simply paste your CSS code into the Minifier.
  2. Select your options: Remove comments, Remove last semicolons.
  3. Click the Minify button to compress your code.
  4. Click the Copy or Download button to save the optimized code.

CSS Minifier Examples

A small rule with a comment, minified with the default options. Keep the readable original for editing.

Input
/* card */
.card {
  margin: 0 auto;
  color: #333333;
}
Result
.card{margin:0 auto;color:#333333}

CSS Minifier — Frequently Asked Questions

What is a CSS minifier?
A CSS minifier is used to parse valid CSS code and then remove all characters that are not necessary for the correct display of a web page. Extra characters include all whitespace characters (such as spaces and tabs), line breaks, and comments.
Is it safe to remove the last semicolons?
Yes, according to CSS specifications, semicolons after the last selector or property in a CSS rule are optional. You can safely remove all last semicolons in your CSS code to make your code lighter.
How to un-minify CSS?
To un-minify CSS, you can use the CSS Formatter tool.