CSS Formatter

Paste a crushed stylesheet, get readable CSS — comments intact, nested at-rules indented, everything local.

Privacy: formatting runs entirely in your browser — your CSS never leaves this page.

How to use

  1. Paste your CSS into the input.
  2. Choose an indent width — output updates as you type.
  3. Copy the formatted result.

Frequently asked questions

What does the formatter do to my declarations?

It puts each declaration on its own line, normalizes the spacing around braces, and indents rules — including rules nested inside @media and other at-rules. Property names and values themselves are kept as written, so minified shorthand like color:red stays compact.

Are comments preserved?

Yes — comments are kept verbatim on their own lines at the correct indent level, so license headers and section notes survive formatting.

What about strings containing braces or semicolons?

They are protected: content like content:"{ not a block" is recognized as a string, so its braces and semicolons do not break the rule structure.

Does it fix syntax errors?

It is a formatter, not a linter — a missing semicolon is tolerated (the formatter continues), but typos in property names stay. Run a validator if you need strict checking.

Is my CSS uploaded anywhere?

No — the whole parse happens in your browser. Safe for proprietary stylesheets.

Comments