CSS Formatter & Minifier
Beautify CSS for reading or minify it for shipping
Runs locally
loading…
About this tool
Expand minified or copy-pasted CSS into one-declaration-per-line rules, or squeeze a stylesheet down for production. The beautifier normalizes indentation and brace placement; the minifier strips comments, collapses whitespace and drops final semicolons while leaving strings, url(...) contents and calc() expressions untouched.
The minifier is transparent about what it does not do: it will not rename selectors, merge duplicate rules or rewrite colors. That makes the output predictable and safe for any stylesheet, including ones with hacks and vendor prefixes — paste, minify, ship.
Like every tool here, processing is local. Unreleased design-system code stays in your browser.
Frequently asked questions
- How much smaller does minified CSS get?
- Typically 15–30% for handwritten CSS, mostly from indentation and comments. Gzip on your server removes much of the same redundancy, so the wire-size delta is smaller than the raw byte count suggests — minify anyway, it also cuts parse time.
- Is it safe for calc(), custom properties and media queries?
- Yes. Spaces inside calc() are significant and are preserved; custom properties and their var() references are plain declarations and survive unchanged; @media and other at-rules keep their structure.
- Why did descendant selectors keep their spaces?
- Because "nav a" and "nava" select different things — the space is a combinator, not formatting. The minifier only removes whitespace that has no syntactic meaning.
- Can it convert between LESS/SCSS and CSS?
- No — preprocessor syntax needs compilation, not formatting. Plain SCSS that is also valid CSS will format fine; nested rules and mixins will not.