Skip to content

Minify CSS

Compress stylesheets with CSSO, which also merges duplicate rules and shortens values, not just whitespace.

  • Runs in your browser
  • Code never uploaded
  • Free

Your CSS

Minified

What CSS minification does

CSS minification removes spaces, comments and redundant characters, shortens colours like #ffffff to #fff, and drops units from zero values. CSSO can also merge rules that share selectors or declarations.

Because CSS blocks the page from rendering until it loads, smaller stylesheets make pages appear faster.

How to minify CSS

  1. 01

    Paste or drop your code

    Paste CSS into the left box, or drop a file onto the page.

  2. 02

    It's minified instantly

    CSSO minifies it as you type. Adjust the options above the editor if you need to.

  3. 03

    Copy or download

    Copy the result, or download it as a .min file. The size savings, including gzipped size, appear below.

Features

Four languages

JavaScript with Terser, CSS with CSSO, HTML with html-minifier-terser, and JSON.

Real savings

See original, minified and gzipped sizes, which is what visitors actually download.

Instant

Minification runs in a background thread as you type, so even large files stay responsive.

Clear errors

Syntax errors show the line and column so you can fix the source quickly.

Your code stays private

Nothing is uploaded. Minify proprietary code without sending it to anyone.

Free and open source

No limits, no sign-up, and the source is on GitHub.

Frequently asked questions

Is my code uploaded?

No. Minification runs entirely in your browser in a Web Worker. Your code never leaves your device.

What does Merge rules do?

It combines selectors with identical declarations and removes overridden properties. This saves more space, but turn it off if your CSS depends on unusual rule order.

Are license comments kept?

Comments that start with /*! are kept when Keep license comments is on. All other comments are removed.

Is minification the same as obfuscation?

No. Minifying makes code smaller and is easy to reverse with a formatter. To make JavaScript hard to read, use the JavaScript Obfuscator at obfuscate.devsamc.xyz.

More free tools