Compress · Shrink · Copy
Minify CSS Online
Updated: June 2026
Every byte of CSS your visitors download costs time. Minifying strips the comments, indentation and line breaks a stylesheet needs for editing but a browser does not — producing a smaller file that loads faster while applying exactly the same styles.
Free · No upload · Instant in the browser
What minifying removes
Minification keeps every rule that affects rendering and discards everything that does not. Comments are removed, runs of whitespace collapse to nothing, the spaces around braces, colons, semicolons and combinators disappear, and the final semicolon before a closing brace is dropped because it is optional. The result is a single compact line that a browser parses just as readily as the expanded version.
The styles are unchanged. Selectors, properties and values are identical to the source — only the bytes that exist purely for human readability are gone.
Why minify CSS
- Smaller files download faster, improving first paint and Core Web Vitals.
- Less CSS means less bytes to parse, which helps on low-end devices.
- Minified assets compress further over gzip or Brotli.
- It is the expected format for production — readable CSS belongs in your source, not on the wire.
Keep the formatted version in version control and serve the minified version to users; that way you get readability where you edit and speed where it counts.
How to minify CSS
Paste your stylesheet into the tool and switch to the Minify tab. The compressed output appears on the right along with how much smaller it became, so you can see the saving at a glance. Copy it or download it as a .min.css file. If you need to go the other way later, the same tool beautifies the minified output back into readable rules.
Safe with comments and strings
Minifying CSS naively can corrupt a stylesheet if a brace or semicolon appears inside a quoted value. This minifier removes comments and collapses whitespace while leaving the structural meaning intact, so quoted font names and url() paths survive. The output re-parses to the same set of rules as the input — it is just smaller.
Runs in your browser
The minifier works locally in JavaScript. Your stylesheet is never uploaded, so unreleased designs and internal class names stay on your machine. There is no server round-trip, so compression is instant even for a large compiled sheet, and you can confirm the privacy by minifying with the network tab open or while offline.
Frequently asked questions
How do I minify CSS?
Paste your CSS into the tool and switch to the Minify tab. Comments and whitespace are stripped and the compact result appears, ready to copy or download.
Does minifying change my styles?
No. Only readability bytes are removed. The selectors, properties and values are identical, so the stylesheet applies the same rules.
How much smaller will my CSS get?
It depends on how much whitespace and comments the source has, but the tool shows the exact percentage saved after each minify.
Is my CSS uploaded anywhere?
No. Minifying runs locally in your browser. Nothing is sent to a server and the tool works offline once loaded.