CSS Formatter & Beautifier

Turn minified or inconsistent stylesheets into readable CSS with one declaration per line. Supports plain CSS, SCSS and Less.

Loading tool…

About the CSS Formatter

The formatter uses Prettier's PostCSS-based parser. Each selector in a list gets its own line, each declaration its own line, and spacing around :, ,, combinators and braces is normalized. Numbers are printed consistently (.5 becomes 0.5), hex colors are lowercased, and string quotes follow the Single quotes setting. Comments are kept.

Pick SCSS or Less for preprocessor syntax — nesting, @mixin/@include, variables like $gap or @gap, maps and guards. Plain CSS mode also understands modern syntax such as native nesting with &, custom properties, @layer, @container and color functions like color-mix().

Formatting is the reverse of minification: use it to read a production stylesheet you only have in minified form, then use the CSS Minifier to shrink it again. Prettier does not reorder properties or remove duplicates — it only changes layout. Syntax errors, such as a missing closing brace, are reported with the line and column.

How to use it

  1. Paste CSS, SCSS or Less.
  2. Choose the syntax, indentation and print width.
  3. Toggle single quotes if your style guide requires them.
  4. Copy or download the formatted stylesheet.

Frequently asked questions

Can I unminify a minified CSS file?
Yes. Paste the minified CSS and the formatter restores line breaks and indentation. Comments and original property order are whatever the minified file still contains.
Does it sort CSS properties?
No. Prettier deliberately leaves declaration order alone because order can change the cascade. Use a Stylelint plugin such as stylelint-order for sorting.
What is the difference between SCSS and Less mode?
They select the matching PostCSS syntax so variables ($x vs @x), mixins and nesting are parsed correctly. Plain CSS mode rejects some preprocessor-only constructs.

Related tools