Minify CSS code online — remove whitespace, comments, and formatting to reduce file size
CSS minification removes whitespace, comments, and line breaks, reducing file size.
This is important for website loading optimization — minified files load faster.
The "Format" button performs the reverse operation — adds indentation for easy reading.
CSS Minifier Online — Compress Styles to Speed Up Your Site
The CSS minifier removes whitespace, line breaks, comments, and redundant characters while preserving full functionality. Typical compression: 20–40%. Also supports beautification (formatting) of minified CSS.
What Gets Removed in CSS Minification
- Comments —
/* ... */. Useful in development, useless in production - Whitespace and indentation
- Line breaks — entire CSS becomes one line
- Trailing semicolons — last property in a block doesn't need
; - Unnecessary zeros —
0px→0,0.5em→.5em
Typical Compression Results
| File | Before | After | Reduction |
|---|---|---|---|
| Bootstrap 5 CSS | 189 KB | 155 KB | 18% |
| Custom Tailwind CSS | 50 KB | 35 KB | 30% |
| Component with comments | 8 KB | 4.5 KB | 44% |
Minification vs Gzip
Minification and Gzip/Brotli complement each other. Gzip efficiently compresses repetitive patterns (common in CSS); minification removes useless characters before Gzip. Combined: minified + Gzip CSS is typically 60–80% smaller than the original.
Frequently Asked Questions
Is CSS minification safe?
Yes. Minification doesn't change style logic — only syntactically meaningless characters are removed.
Can I restore original CSS from minified?
Whitespace can be restored with the "Format" button. Comments are permanently removed.
For JavaScript minification use the JS minifier, for gradients — CSS Gradient.
Useful articles
WCAG Color Contrast: Website Accessibility Guide
A complete guide to color contrast: WCAG 2.1 standards, AA and AAA levels, calculation formula, practical examples of good and bad contrast, and how to fix accessibility issues.
CSS Border Radius: Rounding Element Corners
How to use border-radius: syntax, shorthand notation, elliptical corners. Online border-radius generator.