CSS Minifier
Free online CSS minifier. Compress and minify your CSS in the browser — strip comments, collapse whitespace and remove redundant semicolons to cut file size and speed up your site. Nothing is uploaded.
How to use the CSS Minifier
- 1Paste your CSS into the input box, or drag and drop a .css file onto the editor to load its contents.
- 2Optionally adjust the settings — for example toggle whether to keep license comments (/*! ... */) or strip every comment, and whether to preserve the last semicolon in each rule.
- 3Click the Minify button to process the stylesheet instantly in your browser; nothing leaves your device.
- 4Review the size summary showing original bytes, minified bytes, and the percentage saved.
- 5Click Copy to grab the minified CSS, or Download to save it as a .min.css file ready to deploy.
- 6Clear the editor and repeat for the next stylesheet, or paste minified CSS back in to check the savings on an already-optimized file.
About the CSS Minifier
CSS Minifier compresses your stylesheets by removing everything a browser doesn't need to render the page. Paste raw CSS into the editor and the tool strips comment blocks (both /* ... */ documentation and inline notes), collapses runs of spaces, tabs and newlines into nothing where they're safe to remove, drops the final semicolon before each closing brace, and trims whitespace around colons, commas, braces and combinators. The result is a single dense line of valid CSS that produces byte-for-byte identical rendering but weighs noticeably less. On typical hand-written stylesheets you'll see 20-50% size reduction, and even more on files heavy with comments and indentation.
Everything happens in your browser using JavaScript. Your CSS is never uploaded, logged, or sent to any server — the tool works fully offline once the page has loaded, which makes it safe for proprietary design systems, client work under NDA, or internal component libraries you can't paste into a random web service. Because it's client-side, there's no file size cap imposed by an upload limit; you're only bound by your device's memory.
Real uses: shrinking a stylesheet before deploying a static site to Netlify, GitHub Pages or an S3 bucket where you don't have a build pipeline; squeezing critical CSS inline into an HTML <head> for faster first paint; cleaning up CSS exported from a design tool or copied from a tutorial; or checking how much dead weight your comments and formatting add. Front-end developers, WordPress theme authors, email HTML coders, and anyone hand-maintaining CSS without webpack or PostCSS benefit most.
Practical tips: keep a formatted master copy and only minify the deployment version — minified CSS is painful to edit. Serve minified files with gzip or Brotli on your host for compounding savings. If you use CSS custom properties, calc(), or nested media queries, the minifier preserves them intact since they're syntactically required. For projects that already run a bundler, the built-in minifier is usually enough; this tool shines when you need a quick one-off without spinning up tooling.
Frequently asked questions
Will minifying break my CSS or change how the page looks?
No. The tool only removes characters that are insignificant to the CSS parser — comments, redundant whitespace, and the optional trailing semicolon before a closing brace. Selectors, property values, custom properties, calc() expressions and media queries are left byte-identical, so the rendered result matches your original exactly.
Does it rename classes, merge duplicate rules, or shorten hex colors?
No. This is a whitespace-and-comment minifier, not an optimizer. It won't rewrite #ffffff to #fff, combine two rules that share properties, or remove selectors you no longer use. That keeps the transformation 100% safe and predictable. For aggressive restructuring you'd want a dedicated optimizer like cssnano, but those carry a small risk of behavior changes.
Is there a limit on how large a file I can minify?
There's no upload limit because nothing is uploaded — processing runs locally in your browser. The only practical ceiling is your device's available memory. Stylesheets of a few hundred kilobytes minify instantly; multi-megabyte concatenated files still work but may take a moment on older hardware.
Can I get my original formatted CSS back after minifying?
Not from the minified output — the removed whitespace and comments are gone for good. Always keep your formatted source file as the working copy and treat the minified version as a disposable build artifact. If you only have minified CSS, you can run it through a CSS beautifier to restore readable indentation, though comments won't return.
Should I still minify if my server already uses gzip or Brotli?
Yes, they stack. Gzip and Brotli compress the bytes over the wire, but minification first removes bytes the browser has to parse after decompression, cutting both transfer size and parse time. Minified CSS also compresses slightly better because there's less repetitive whitespace for the algorithm to encode.
Related tools
Browse all free online tools in Text tools and more.
Frequently asked questions
Is this CSS minifier free and private?+
Yes. Minification runs entirely in your browser — your CSS is never uploaded, with no limits or watermarks.
What does the CSS minifier do?+
It removes comments, collapses whitespace and line breaks, strips spaces around braces and colons, and drops the last semicolon before each closing brace.
How much smaller will my CSS be?+
It depends on your formatting and comments, but the tool shows the original size, minified size and exact percentage saved as you type.