CSS Minifier Online
Paste or upload CSS — get instant minified output with size reduction stats
Paste your CSS, get a minified version with comments and whitespace stripped out — ready to drop into production. The stats bar shows exactly how many bytes you saved. And everything runs in your browser. Nothing gets uploaded.
How It Works
The parser walks through your CSS character by character. It removes all comments, collapses consecutive whitespace into nothing, drops unnecessary semicolons, and trims whitespace around selectors, colons, and braces. The output is valid CSS that renders identically — just smaller.
Examples
Cleaning Up a Button Component
You wrote a button style with comments and generous spacing during development.
/* Primary button */
.btn-primary {
background-color: #3b82f6;
color: #ffffff;
padding: 0.75rem 1.5rem;
border-radius: 8px;
/* hover state */
transition: background 0.2s;
}
.btn-primary:hover {
background-color: #2563eb;
}
.btn-primary{background-color:#3b82f6;color:#fff;padding:.75rem 1.5rem;border-radius:8px;transition:background .2s}.btn-primary:hover{background-color:#2563eb}
Shrinking a Media Query Block
Responsive breakpoints get verbose fast. Here is a typical mobile override.
@media (max-width: 768px) {
.sidebar {
display: none;
}
.main-content {
width: 100%;
padding: 1rem;
}
}
@media(max-width:768px){.sidebar{display:none}.main-content{width:100%;padding:1rem}}
Full Reset Stylesheet
Reset files are mostly whitespace and comments. They shrink dramatically — sometimes 60% or more.
/* Box sizing reset */
*, *::before, *::after {
box-sizing: border-box;
}
/* Remove default margin */
body, h1, h2, h3, p, ul, ol {
margin: 0;
padding: 0;
}
/* Smooth scrolling */
html {
scroll-behavior: smooth;
}
*,*::before,*::after{box-sizing:border-box}body,h1,h2,h3,p,ul,ol{margin:0;padding:0}html{scroll-behavior:smooth}
Who Uses This
Minify stylesheets before each production deploy to cut page load times.
Compress custom theme CSS for WordPress or Squarespace uploads.
Squeeze inline CSS under email client size limits so styles don't get clipped.
Learn what minified CSS looks like and compare it against the readable version.
Common Mistakes
A missing closing brace or stray colon in the original file will carry into the output — and be much harder to find once whitespace is gone. Validate first, minify second.
You download styles.min.css and accidentally save it as styles.css. Now the readable version is gone. Always keep the original and use a .min.css naming convention.
Minifying removes whitespace and comments — it does not merge duplicate selectors, remove unused rules, or auto-prefix properties. That is a different category of tool entirely.
Technical Details
- Processing: 100% client-side — your CSS never leaves the browser
- Browser Support: Chrome, Firefox, Safari, Edge
- Max Input Size: Limited only by your browser's available memory
- Output Encoding: UTF-8
Frequently Asked Questions
Does minifying CSS break anything?
Not if your CSS is valid to begin with. Minification only removes characters the browser ignores — comments, extra whitespace, trailing semicolons. The rendered page looks identical. If something breaks, the bug was already in the original file.
How much smaller will my CSS file get?
Typical savings range from 15% to 40%. Files with lots of comments and generous formatting shrink the most. Already-compact CSS might only drop 5-10%. The stats bar above the output shows you the exact numbers.
Is CSS minification the same as CSS compression?
Related but different. Minification rewrites the file to be smaller by removing whitespace and shortening values. Compression — like gzip or Brotli — is done by the web server and squeezes bytes further during transfer. For best results, do both: minify first, then serve with compression enabled.
Can I undo minification?
Sort of. A CSS beautifier can re-add whitespace and indentation, but it won't restore your original comments or variable names if you used custom properties. That is why keeping the unminified source file matters.
Should I minify CSS for every project?
For anything public-facing, yes. Even a small site benefits from faster first paint. For internal tools or prototypes where file size is irrelevant, skip it. But it takes two seconds here, so there is not much reason not to.