Development

CSS Minifier

Shrink CSS for faster loading or turn minified CSS back into readable code – with a safe parser of its own, error hints with line and column and the real savings including gzip.

  • Runs entirely in your browser
  • No data upload
  • No sign-up
  • Free
Indentation

CSS

Minified

Guide

How it works

  1. Paste CSS

    Paste your CSS into the left field, drag a .css file in or open it with “Open file”.

  2. Choose a mode

    “Minify” removes everything the browser does not need. “Format” turns compact CSS back into well-readable code with indentation.

  3. Check the notes

    If the tool finds errors such as a missing bracket or an unclosed comment, you see the line, column and a link to the spot.

  4. Use the result

    Copy the result or download it as .min.css. The bars show how much smaller the file has become – also after gzip.

FAQ

Frequently asked questions

What exactly does the CSS minifier do?

It removes comments, line breaks and unnecessary spaces as well as the last semicolon of each rule. With “Shorten values” it also shortens colors (#ffffff → #fff, rgb(255,0,0) → #f00), removes unnecessary units for 0 and zeros in numbers (0.50 → .5) and turns bold/normal into 700/400.

Can minifying break my layout?

The minifier reads the CSS with its own parser following the official CSS syntax and only removes whitespace where it demonstrably has no meaning. For example, the spaces in calc(100% - 10px) and in “a :hover” are kept. Values in calc(), in CSS variables and for flex-basis are deliberately left unchanged.

What are license comments?

Comments starting with /*! usually contain copyright and license notices, e.g. in Bootstrap. Many licenses require them to be kept – that is why the minifier keeps them by default.

Is minifying worth it if the server uses gzip?

Yes, though less so: gzip compresses whitespace very well. Still, 10–20% less data is typical. The tool shows you both values – before and after, each with gzip.

Are Sass or Less supported?

The tool processes normal CSS including modern features such as CSS nesting, @layer and @container. Sass or Less code should be compiled to CSS first.

Is my CSS uploaded?

No. Everything happens locally in your browser, including opening files.