1. Home
  2. Code
  3. CSS Minifier & Beautifier

CSS Minifier, Beautifier & Deduplicator

Minify or beautify a stylesheet, or merge duplicate CSS rules. The result is smaller and still valid CSS.

What it is for?
Processed on the server Free, no sign-up

What it is for?

Use this when a stylesheet goes to production and should be as small as possible, or when you get a minified file and need to read it. It also helps clean up CSS that has grown over years of edits, where the same selector is written several times.

How it works

Compress strips comments and whitespace. With "Deduplicate CSS" ticked, repeated declarations and rules are merged first, colours are shortened and empty rules are dropped, so the output gets smaller still.

Beautify keeps every rule as written and only re-indents it.

What Compress changes

  • Without Deduplicate, comments that start with /*! are kept, since they usually hold a license. All other comments go.
  • Zero values lose their unit, so margin: 0px becomes margin:0, and 0.5em becomes .5em.
  • Hex colours such as #ffcc00 are shortened to #fc0.

Check the result after deduplicating

Merging changes the structure of the file. In CSS, when two rules with equal specificity set the same property, the one written later wins, so a merge can change the result in rare cases. Test the page after a deduplicated build, and keep the original file as the one you edit.

Where your code goes

Compress and Beautify run on our server. The stylesheet is sent with the request and returned processed; the tool does not save it.