This tool minifies CSS to make your stylesheet smaller and faster to load, entirely in your browser. Paste your CSS and it removes everything the browser does not need — comments and redundant whitespace and punctuation — without changing how the styles render. It is handy for shrinking a stylesheet before deployment when you do not want to set up a build step.
Why CSS file size matters
Every byte of CSS is render-blocking by default: the browser must download and parse your stylesheets before it can paint anything on screen. A 50 kB unminified stylesheet full of comments and indentation might compress to 25–35 kB when minified, then compress further over the network with gzip or Brotli. The combination of minification plus compression typically cuts CSS transfer sizes by 60–80% compared with unminified, uncompressed source.
Even if your build pipeline already minifies CSS, having a quick browser-side tool is useful for: auditing a stylesheet pulled from a CDN, shrinking a one-off snippet before pasting it into a CMS, or verifying that your minifier hasn’t dropped important rules.
What the minifier removes
The minifier walks through the source and applies these transformations while leaving string contents untouched:
- Strips
/* ... */comments. This includes multi-line comments and licence headers that you may want to keep in source but not in production. - Collapses runs of whitespace to a single space, then removes spaces around the structural punctuation
{ } : ; ,and combinators such as>and~. - Drops the unnecessary semicolon before each closing brace. The final declaration in a rule never needs a trailing semicolon; browsers tolerate it but it wastes a byte.
- Preserves quoted strings verbatim. Content inside
url("..."),content: "...", andfont-family: "..."values is copied without modification, so values with embedded spaces or punctuation are never corrupted.
Worked example
This input:
/* Card component */
.card {
display: flex;
padding: 12px;
color: #ffffff;
background-color: #1a1a2e;
}
/* Card header */
.card__header {
font-size: 1.25rem;
font-weight: 600;
}
minifies to:
.card{display:flex;padding:12px;color:#ffffff;background-color:#1a1a2e}.card__header{font-size:1.25rem;font-weight:600}
The comments, indentation, line breaks and the trailing semicolons before each } are all gone. Both rules behave identically in a browser.
What this minifier does not do
This is a whitespace and comment stripper, not a full CSS optimiser. It does not:
- Merge duplicate selectors or properties
- Shorten hex colours (
#ffffff→#fff) - Remove unused rules
- Reorder properties for better gzip compression
For those optimisations, build-time tools such as cssnano, Lightning CSS, or PurgeCSS go further. This tool is for quick, safe reductions with no dependencies.
Everything runs locally in your browser — nothing is uploaded.