CSS formatter
Processed in your browser · nothing is uploaded
Puts each declaration on its own line and indents nested blocks, or strips it all back out. Minifying also removes comments and the final semicolon in each block.
How to use the css formatter
Dropping the last semicolon is safe and is what every minifier does: CSS needs a semicolon between declarations, not after the last one. Two things this deliberately does not do, because both change behaviour: it does not merge duplicate selectors, since the cascade means order matters and merging can change which rule wins, and it does not shorten colours or units.
That restraint is the point of a formatter. Nothing is reordered, so the cascade after formatting is identical to the cascade before it, and a reviewer reading the tidied file is reading the same stylesheet. A tool that rewrites values to save bytes is a different kind of tool, with a different kind of risk, and gzip recovers most of what it would have won.
One thing to check after minifying: whitespace inside calc() is part of the syntax, not decoration. calc(100% + 10px) needs the spaces around the +, and stripping them gives calc(100%+10px), which is invalid and simply dropped by the browser. Any calc that adds or subtracts is worth a look before you ship the minified file.
Formatting is not linting either. It indents by brace depth and reports nothing: a misspelled property, an invalid colour and an unbalanced brace all pass through it. The unbalanced brace at least announces itself, as everything below it indented one level too deep.
Questions
Yes. CSS needs semicolons between declarations, not after the last one in a block.
No, deliberately. The cascade depends on order, so merging can change which rule wins.
No. It changes formatting only, never values.
It can. The spaces around + and − inside calc() are required by the syntax, and minifying removes them. Check any calc that adds or subtracts.
No. It is a formatter, not a linter. An unbalanced brace shows up as everything below it indented one level too deep.
Typically 20 to 30 percent before compression, considerably less after gzip.
No.