Skip to content
ToolMug

CSS Minifier

Compress style sheets for production. CSSO removes whitespace and comments, shortens colours and values, and merges rules that repeat the same selector — often saving more than whitespace removal alone.

Runs in your browser — nothing you enter is uploaded

How to use

  1. Paste your CSS.
  2. Choose whether to restructure rules and keep license comments.
  3. Click Minify, or press Ctrl+Enter (⌘+Enter on Mac).
  4. Copy or download the minified CSS.

Options explained

Merge and restructure rules
Combines rules with the same selector or the same declarations when it is safe to do so. Turn off to only remove whitespace and shorten values.
Keep license comments
Keeps comments that start with /*!, which is the convention for license notices.

Examples

a { color: #ff0000; }
/* note */
a { margin: 0px; }

minifies to a{color:red;margin:0}.

Frequently asked questions

What gets shortened?

Colours (#ff0000 → red, #ffffff → #fff), zero units (0px → 0), redundant semicolons and quotes, and whitespace. With restructuring on, duplicate rules are merged.

Can restructuring change how my page looks?

CSSO only moves declarations when the cascade result stays the same. If you rely on unusual hacks, compare the result or turn restructuring off.

Is my code uploaded?

No. Minification runs in your browser.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools