CSS Minifier & Beautifier

Compress CSS for production, or expand minified CSS to read it.

🔒 Runs entirely in your browser. Nothing you enter is uploaded or stored.

What is the CSS Minifier & Beautifier?

Minifying CSS removes everything the browser doesn't need: comments, line breaks, indentation, spaces around braces and colons, and the last semicolon in each rule. The result behaves exactly the same but is typically 20–40% smaller, so pages load faster. That helps your Core Web Vitals and SEO.

This minifier protects the parts where whitespace matters. Quoted strings, url() values such as inline SVG data URIs, and math inside calc() (where + and - must keep their spaces) are left untouched. A space before a colon is also kept, because a :hover and a:hover are different selectors. Beautify does the reverse: it puts each declaration and selector on its own line, so you can read and debug minified CSS from a website or a library.

How to use the CSS Minifier & Beautifier

  1. Paste your CSS (or minified CSS you want to read).
  2. Click Minify to compress or Beautify to format.
  3. Tick Keep /*! license */ comments if your CSS includes licence headers that must stay.
  4. Copy the result or download a .css file.

Frequently asked questions

Is minified CSS safe to use in production?

Yes. Minification only removes characters that have no effect on how browsers read CSS. Keep the readable original in your source code and serve the minified version.

How much smaller will my CSS be?

Usually 20–40% before compression. With gzip or Brotli on your server, the transferred size shrinks further, and minification still helps because there is less to download and parse.

Why are spaces kept inside calc()?

The CSS specification requires whitespace around + and - in calc(). calc(100%-2rem) is invalid, so removing those spaces would break your layout.