CSS Minifier

Strip a stylesheet down to the bytes that matter.

Minified

About this converter

Runs csso, which does more than strip whitespace: it merges rules with identical bodies, removes declarations that a later rule overrides, and shortens values — #ffffff to #fff, 0px to 0.

That structural work is where the real saving is, and it is also why a regular expression is not a substitute. A stylesheet contains strings, and a content property or a url() with a brace in it will defeat anything that is not a parser.

It is safe in the sense that matters: the rules are reordered only where reordering cannot change which one wins. Where the cascade is ambiguous, it leaves things alone.

Frequently asked questions

Can minifying break my styles?

It is designed not to, and it only reorders where the cascade guarantees the outcome is the same. The one thing to watch is a stylesheet that depends on a declaration a later rule already overrides — a hack relying on that will be removed, correctly, and may still surprise you.

Does it remove unused rules?

No, and it cannot. Knowing a rule is unused means knowing every page it might apply to, plus anything JavaScript adds at runtime. That is what a tool like PurgeCSS does with your templates in front of it, and it is a different job from minifying.

Does what I paste get sent anywhere?

No. Everything runs in your browser, on your own machine. Nothing is uploaded and nothing is logged. That matters more here than on most pages — source code, database queries and internal data are exactly the things that get pasted into tools like this, and most of them are a form that posts to a server.

Related tools