Use this free CSS minifier to shrink a stylesheet by removing comments and extra whitespace, or use the beautifier to turn compressed CSS back into readable code. Choose Minify or Beautify, paste your CSS, pick how to handle comments, and click Convert. The tool shows how much smaller or larger the output is, and lets you copy the result or download it as a .css file.

Minify a copy for production and keep your readable source for editing. Minified CSS is harder to change by hand.

How to use the CSS minifier / beautifier

  • Choose a mode: Minify removes whitespace and comments, and Beautify adds indentation and line breaks.
  • Paste your CSS: add the stylesheet or snippet you want to convert.
  • Pick comment handling: remove all comments, or keep /*! license comments when minifying.
  • Convert, then copy or download: click Convert, then copy the result or save it as a .css file. Use Swap to send the result back through the opposite mode.

Minify or beautify

ModeWhat it doesBest for
MinifyRemoves comments and whitespace, shortens hex colors, and drops units from zero valuesProduction stylesheets and faster page loads
BeautifyAdds indentation, line breaks, and spacing around declarationsReading, editing, and debugging minified CSS

Common uses for CSS minification

  • Faster pages: smaller stylesheets download sooner, which helps rendering on slow connections.
  • Snippets for email or embeds: compact CSS fits in tight spaces such as inline style attributes.
  • Debugging third-party files: beautify a minified vendor stylesheet to see its rules clearly.
  • Size checks: compare the before and after sizes to see how much a stylesheet can shrink.
Minifying is a final step before deployment. Keep your formatted source under version control and generate the minified file from it.

Worked examples

Minify a rule

Enter .box { margin: 0px; } in Minify mode. The output is .box{margin:0}, and the summary shows how many bytes were removed.

Beautify a rule

Switch to Beautify and paste .box{margin:0}. The tool returns the rule on separate lines with indentation, so each declaration is easy to read.

Keep a license comment

Choose Keep /*! comments before minifying a file that starts with /*! Library v2.1 MIT */. The notice stays at the top of the output, and other comments are removed.

Frequently asked questions

Is this CSS minifier free to use?

Yes. You can minify, beautify, copy, and download CSS without creating an account.

Is my CSS uploaded or stored?

No. All conversion happens in your browser. Nothing you paste is sent to a server or saved, and clearing the form removes it from the screen.

Will minifying change how my styles work?

Usually not. Minifying removes comments and extra whitespace and shortens some values. Strings and URLs are kept as written. Keep your original, readable file for editing.

What does Keep /*! comments do?

Comments that start with /*! are often license notices. Keeping them preserves required attributions while removing all other comments.

Does the tool check whether my CSS is valid?

No. The tool checks that curly braces match, but it does not verify property names or values. Use a CSS validator to check for errors.

Why does the tool show a brace error?

Every opening brace needs a matching closing brace. A missing or extra brace stops the tool so it does not produce broken output.

Share this article