CSS Minifier
Remove whitespace, comments and redundant characters from CSS. Reduce file size for faster pages.
CSS files grow over time as styles accumulate across feature development cycles. Whitespace, comments, and formatting that aid development add no value in production — they only increase file size and load time. Minifying CSS reduces file size by removing all redundant characters: whitespace, comments, and the last semicolon before a closing brace. Combined with gzip compression, minified CSS can be 70–90% smaller than the original, resulting in measurably faster page loads.
📋 How to Use This Calculator
Paste your CSS into the input area — class rules, media queries, keyframe animations, custom properties, anything. Click "Minify CSS" to produce compact CSS with all whitespace and comments removed. The tool shows you the original and minified character counts along with the percentage reduction. Copy the result and use it in your production build, CDN, or directly in a <style> tag. Always keep your original, commented CSS for development; minify as part of your build pipeline.
💡 Key Facts & Information
CSS minification performs several transformations: removes /* block comments */ (preserving copyright comments marked as /*! is supported by some minifiers but not this basic tool), removes whitespace around property delimiters (: ; , { }), removes the trailing semicolon before closing braces, and collapses multiple whitespace characters to single spaces. It does not perform more advanced optimizations like shorthand property merging (margin: 10px 10px 10px 10px → margin: 10px), color shortening (#ffffff → #fff), or property deduplication — those require a full CSS optimizer like cssnano or clean-css.