Skip to tools

Minifiers

CSS Minifier

Stylesheets are render-blocking, so every byte counts. The CSS Minifier removes comments, line breaks and unnecessary spaces to produce a compact stylesheet that loads faster.

Use it for quick one-off optimisations when you do not have a build tool, or to check how small a stylesheet can get.

How to use the CSS Minifier

  1. 1Use the CSS Minifier right on this page, or open the full workspace for history, sharing and every other tool.
  2. 2Paste your input, upload a file, or drag and drop a file onto the input box (up to 25 MB).
  3. 3The result appears in the output panel automatically and updates when you change the input or an option.
  4. 4Use Copy Output or Download to save the result. Nothing is uploaded to a server.

Example

A commented, indented stylesheet is reduced to a single compact line.

Input
/* main */
body {
  margin: 0;
  padding: 0;
}
Output
body{margin:0;padding:0}

When to use it

  • Optimising CSS for a small static site without a build pipeline
  • Inlining critical CSS into the <head> of a page
  • Reducing the size of styles embedded in emails or widgets

Tips and common mistakes

  • Comments are removed — keep licence headers in a separate file if required.
  • Format the result with the CSS Formatter whenever you need to edit it again.
  • Test the page after minifying to confirm nothing changed visually.

Frequently asked questions

Is this as good as a build-tool minifier?

It removes whitespace and comments, which is most of the savings. Advanced tools may also merge rules and shorten values.

Can I undo minification?

Yes — paste the result into the CSS Formatter to make it readable again.

TutorialHTML, CSS and JavaScript beautification: a quick tour

Related tools

Ready to try it?

Free, no sign-up, and your data never leaves your browser.