Tool Logo

CSS Minifier

Make stylesheets smaller without changing how the page looks.

0 characters

Loading tool…

How to use the css minifier

The minifier uses CSSO, a CSS minifier that understands CSS syntax instead of using text replacement. It removes whitespace and comments, shortens colours (#ffffff becomes #fff) and zero values, and can merge duplicate rules. Strings, url() values and @media blocks are kept intact, so the result renders exactly like the original.

  1. Paste your CSS or upload a .css file.
  2. Choose whether to merge rules and whether to keep /*! licence comments.
  3. Check the size saving and copy the minified CSS.

When to use it

  • Faster pages

    Shrink stylesheets so they download and parse faster.

  • No build step

    Minify CSS for a small site without setting up a toolchain.

  • Inline styles

    Make critical CSS small enough to inline in the <head>.

Frequently asked questions

Can minifying break my CSS?

CSSO parses the stylesheet and only applies safe transformations, so the result renders the same. Strings such as content values and url() paths are never changed.

What does "merge rules" do?

It combines rules with the same selector or the same declarations to save more space. Turn it off if you need to keep the exact rule order, for example while debugging.

Are comments removed?

Yes, all comments are removed by default. You can keep comments that start with /*!, which is how licence notices are usually marked.

How much smaller will my CSS get?

Usually 15 to 30 percent for hand-written CSS, more for verbose stylesheets. The saving is shown under the result.

Is my CSS uploaded?

No. Everything runs in your browser; nothing you paste or upload is sent to our servers.