Format messy CSS into readable rules
Inherited minified one-liner? Paste it in, get it back with real indentation — or minify clean CSS the other way.
Tools used in this guide
The job
Someone handed you styles written in one giant line, or with three different indentation styles — and you need to read them before you can change them. Reformatting is purely cosmetic: same rules, same values, new whitespace.
Pretty or minified
Paste the CSS, pick Pretty for readable output with one declaration per line, or Minified for a single compact line. The Pretty output puts each selector and its braces on their own lines and indents declarations, so diffs stay small when you paste the result into source control.
- Comments, at-rules like @media, and nested blocks are kept and re-indented.
- Minified strips comments and collapses whitespace — useful before pasting into a platform that charges by bytes.
Worked example
A 4 KB widget stylesheet minified to a single line formats back to about 120 readable lines — the duplicate `margin` declaration that was invisible in the one-liner becomes obvious.
Where it stops
It formats, it does not validate: a misspelled property stays misspelled, and unsupported values are passed through untouched. Input is capped at 2 MB / 500 rules; minified output uses safe whitespace collapsing, not an aggressive compressor like cssnano.