Skip to content
toolgrid

No tool found. Try another word.

CSS Formatter

Beautify minified or messy CSS: one declaration per line, consistent indentation and blank lines between rules. Works with media queries and nested rules.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the CSS Formatter

  1. 1 Paste your CSS, minified or not.
  2. 2 Choose the indentation and whether rules get a blank line between them.
  3. 3 Copy the formatted CSS or download it.

About the CSS Formatter

Minified stylesheets from a website or a build tool are compressed onto a few long lines, which makes them impossible to read. The CSS formatter (sometimes called an unminifier) puts every selector, declaration and closing brace on its own line with consistent indentation.

At-rules such as @media, @supports and @font-face are indented like nested blocks, and comments stay where they are. The formatter only changes whitespace, so the stylesheet behaves exactly the same after formatting.

It is based on js-beautify's CSS formatter. It does not reorder properties, remove duplicates or fix errors; for that, a linter such as Stylelint is the right tool. To make CSS small again for production, use the CSS minifier.

Frequently asked questions

Can I unminify CSS from a website?

Yes. Copy the stylesheet (for example from the Network or Sources tab of your browser's developer tools) and paste it here to make it readable.

Does formatting change how the CSS works?

No. Whitespace between tokens has no meaning in CSS, apart from a few places such as inside strings and between descendant selectors, which the formatter preserves.

Does it support SCSS or Less?

Simple SCSS and Less with nested rules usually format well, but the formatter is made for CSS, so some preprocessor syntax may come out oddly.

Are comments removed?

No, comments are kept. The CSS minifier removes them, except /*! … */ license comments if you choose.