Compress CSS Stylesheets in Your Browser
This CSS minifier shrinks stylesheets by stripping every byte the browser does not need to render your page. It removes comments, collapses whitespace, drops trailing semicolons, shortens zero units and hex colors — turning bloated development CSS into lean, production-ready code that downloads and parses faster.
Why Minify CSS
Faster Page Loads
Lower Bandwidth
No Build Step
How to Minify CSS Code
Paste or Upload Your CSS
Type or paste your stylesheet into the input panel, or use Upload to load a .css file. Try the Sample button to see it in action. Minification also runs automatically as you type.
Set the Comment Option
Toggle Remove comments on to strip every /* ... */ block, or off to keep license headers and notes.
Minify
Click Minify or press Ctrl + Enter. The compressed CSS appears instantly with syntax highlighting in the output panel.
Review & Export
Check the stats bar for original size, minified size, and percent saved. Then Copy the result or Download it as minified.css.
What the CSS Compressor Optimizes
The minifier applies safe, well-established transformations that shrink your CSS without changing how it renders.
| Optimization | Before | After |
|---|---|---|
| Strip comments | /* header */ | (removed) |
| Collapse whitespace | margin: 0 auto; | margin:0 auto |
| Trailing semicolons | color:red;} | color:red} |
| Zero units | padding: 0px; | padding:0 |
| Shorten hex colors | #ffffff | #fff |
Built to Stay Valid
Preserves calc() Expressions
Spaces around operators inside calc() are required by the spec, so the minifier protects them and your math keeps working.
Comment Toggle
Keep or strip /* */ comments with a single switch — handy for retaining license banners.
Live Compression Stats
See original size, minified size, and the percentage saved after every run.
Upload, Copy & Download
Load a .css file from disk, copy the result to your clipboard, or download it as a file.
Frequently Asked Questions
What does minifying CSS actually do?
It removes characters the browser doesn't need to render the page — line breaks, indentation, comments, and spaces around braces, semicolons and colons — plus safe shortcuts like 0px → 0 and #ffffff → #fff. Selectors, properties, values and cascade order are preserved exactly.
How much smaller will my CSS get?
Most stylesheets shrink by about 20–50%, depending on how many comments and how much whitespace the original contains. Heavily documented or generously formatted CSS sees the largest savings. The stats bar shows the exact percentage for your file.
Will minification break my stylesheet?
No. The minifier only removes unnecessary characters and safely shortens values. It protects calc() expressions and leaves media queries and selectors untouched, so the rendered result is identical to your source.
Can I unminify or format minified CSS again?
This tool only minifies. Because minification is a formatting change, a code beautifier can re-indent the output, but original comments and naming are gone. Always keep your unminified source for development and minify only the copy you deploy.
Is minifying the same as gzip compression?
No — they stack. Minification rewrites the CSS to remove redundant characters; gzip or Brotli then compresses the transferred bytes at the server level. Minify first, then let your server apply gzip on top for the smallest download.
Does it remove license comments?
If Remove comments is on, all /* */ comments are stripped, including license headers. Turn the option off when you need to preserve attribution or legal notices.
Is my code sent to a server?
No. All minification happens locally in your browser using JavaScript. Your CSS is never uploaded, logged, or stored anywhere.
No comments yet. Be the first to comment!