CSS Minifier

Compress CSS to ship it smaller, or beautify minified CSS back into readable code - with the size saving shown.

Input
0 B
Output
0 B
Saved
0%

Why minify CSS

Every byte of CSS is downloaded and parsed before a page can finish rendering. Comments, generous indentation and blank lines make a stylesheet pleasant to work on but do nothing for the browser. Minifying removes all of that, so the file transfers faster and the page paints sooner - a small win that adds up across every visitor.

What safe minification removes

  • All /* comments */
  • Line breaks, tabs and runs of spaces between rules and declarations
  • Spaces around {, }, :, ; and ,
  • The final semicolon before each closing brace

What it never touches: your selectors, property names, values, and anything inside quotes or url(). That last point matters - a naive minifier that collapses every double space would corrupt content: "hello world". This one tracks string boundaries so that never happens.

Beautify for reading and debugging

Inherited a compressed stylesheet with no line breaks? Switch to Beautify and it comes back formatted: one selector per block, each declaration on its own line, a space after every colon, and clean two-space indentation. It is the fastest way to make a minified file reviewable again before you edit it.

Building the front end? Pair this with the CSS gradient generator and the color picker for styling, or the JSON formatter when you switch back to data.

Frequently asked questions

What does minifying CSS actually do?
Minifying strips everything a browser does not need to read the styles: comments, line breaks, indentation and the spaces around braces, colons and semicolons. The rules themselves are untouched, so the page looks identical - the file is just smaller and faster to download.
Is minified CSS safe to ship to production?
Yes. Minification only removes optional whitespace and comments; it never changes selectors, property names or values. This tool also respects strings, so content like content: "a b" and url() values keep their exact spacing.
How much smaller does CSS get?
It depends on how heavily commented and indented the source is. A typical hand-written stylesheet shrinks by 20 to 40 percent, and heavily commented files can drop by more than half. The exact saving is shown above every time you minify.
Can I un-minify CSS to read it again?
Yes. Switch to Beautify and this tool re-indents the CSS with each rule on its own lines, a space after every colon and consistent two-space indentation, so a compressed one-liner becomes readable again.
Does my CSS get uploaded anywhere?
No. All processing happens in your browser with JavaScript. Your stylesheet is never sent to a server, so it is safe to paste proprietary or unreleased code.