CSS Minifier: Compress CSS Code Online

Make stylesheets smaller for faster websites. The result appears as you type.

Input
Result

How to use

  1. Paste CSS or open a .css file.
  2. Keep "Merge and reorder rules" on for the smallest file, or off for a cautious result.
  3. Copy or download the .min.css and check the saving.

Good to know

The minifier uses csso (MIT licence). Besides removing whitespace and comments it shortens values: #ff0000 becomes red, 0px becomes 0, and repeated selectors can be merged.

Comments that start with /*! (usually licence notes) are kept, as most licences require. Turn off "Merge and reorder rules" if your CSS depends on a very specific rule order or uses unusual hacks; the result will be a bit larger but closer to the original.

Always keep your readable source file and minify a copy for production. Servers also gzip CSS, so the network saving is smaller than the file-size saving shown here.

Questions

Will minified CSS look the same?

It should. csso only applies changes that keep the meaning. Test once in your browser.

Why did my colours change from #ff0000 to red?

Both mean the same colour; the shorter form saves bytes.

Are licence comments removed?

No, comments starting with /*! are kept.

Can I minify Bootstrap or other big files?

Yes, files of several MB work.

Is my CSS sent anywhere?

No. Processing happens in your browser.

Last updated: