Guides Favs 0

Home / Developer / CSS Formatter & Minifier

CSS Formatter & Minifier

Beautify CSS with consistent indentation, or minify it for production.

Safe minification: strips comments and whitespace, drops the last semicolon in each block, shortens colours like #ffffff to #fff and removes units from zero values — while leaving strings and url() values untouched. Comments starting with /*! (licence notices) are kept.

About the CSS Formatter & Minifier

The CSS Formatter and Minifier beautifies stylesheets with consistent indentation and optional blank lines between rules, or minifies them for production by removing whitespace and comments. Use it to read compressed CSS from a live site, tidy up a messy stylesheet before committing it or shrink CSS so pages load faster.

How to use the CSS Formatter & Minifier

  1. Paste your CSS.
  2. Choose the indent size and whether to add a blank line between rules.
  3. Click Format to beautify or Minify to compress.
  4. Copy the result.

Frequently asked questions

Why minify CSS?

Smaller stylesheets download and parse faster, which helps page speed and Core Web Vitals. Minifying removes spaces, line breaks and comments without changing how styles apply.

Can I un-minify CSS?

Yes. Paste minified CSS and click Format to get readable, indented code back. Comments that were removed during minification can’t be recovered.

Does it support media queries and modern CSS?

Yes. Media queries, nested at-rules, custom properties and modern selectors are kept intact.