Tool Logo

CSS Formatter

Turn minified or messy CSS into clean, readable stylesheets.

0 characters

Loading tool…

How to use the css formatter

Paste CSS, even a minified one-line stylesheet, and the formatter prints it back with one rule and one declaration per line, consistent spacing and indentation. It uses Prettier, the formatter most front-end projects rely on, so nested @media and @supports blocks, comments and strings are handled correctly. Only the layout changes; the CSS does exactly the same.

  1. Paste your CSS or upload a .css file.
  2. Choose indentation, line width and quote style.
  3. Copy the formatted CSS.

When to use it

  • Minified stylesheets

    Expand a .min.css file to inspect or edit it.

  • Inherited code

    Clean up inconsistently written CSS before working on it.

  • Code reviews

    Format CSS the same way across a team.

Frequently asked questions

Does formatting change my styles?

No. Only whitespace, line breaks and quote style change. Selectors, properties, values and their order stay the same.

Can it format minified CSS?

Yes. A minified stylesheet on a single line is expanded to one declaration per line, including rules inside @media and @supports.

Does it support SCSS or Less?

This page formats standard CSS. Plain CSS features such as custom properties, nesting and @layer are supported.

What if my CSS has a syntax error?

You'll see the error and its line instead of a result. The CSS Validator lists every problem it finds.

Is my CSS uploaded?

No. Everything runs in your browser; nothing you paste or upload is sent to our servers.