CSS Minifier & Beautifier
Minify CSS safely (comments, whitespace, 0px → 0, #ffffff → #fff) or beautify it one declaration per line — in your browser, with bytes saved shown.
Minified or pretty-printed CSS with the byte saving, rule and declaration counts, and a warning for anything odd (unclosed blocks, stray text); computed styles never change.
Example: A 6-rule sheet with comments, "0px", "0.5em" and "#FFFFFF" minifies to one line at "#fff", "0", ".5em" and no comments except the /*! banner; beautify puts it back with a blank line between rules.
Smaller CSS,
same computed styles.
What the minifier is allowed to change, what it deliberately leaves alone, and how the beautifier lays rules out.
What minify changes
The sheet is parsed into rules, declarations and comments (strings, url(), parentheses and nested blocks respected), then written back without comments (a comment starting /*! is kept — licences live there), without whitespace the grammar does not need, without the last semicolon of a block, and without empty rules. Three value shortenings are applied because the specification defines them as identical: a bare zero loses its unit outside functions (0px → 0, but calc(0px + 1em) is untouched), a leading zero is dropped (0.5em → .5em), and a six-digit hex colour with doubled digits becomes three (#ffffff → #fff).
What it never does
No property merging, reordering, shorthand rewriting, vendor-prefix removal or colour-name conversion — those can change the cascade or the rendered result in edge cases, and a "safe" minifier should not need trust. Custom properties (--name) are copied verbatim because their values are untyped text. Unclosed blocks are closed at the end and flagged; text with no property: value shape is kept as-is and flagged.
Beautify
One declaration per line, your indent (spaces or a tab), a blank line between rules, nested rules indented one level, and optionally one selector per line. Values are normalised only in spacing (a single space after commas outside functions). Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
Last reviewed 20 September 2026. How results are checked: How we verify.