CSS
CSS Formatter
Minify and beautify CSS.
About CSS formatting
Minifying CSS removes whitespace, comments, and redundant characters to cut file size. Beautifying expands it back into indented, one-rule-per-line style that's easier to scan and edit.
Minifying here goes slightly beyond whitespace removal: it also rewrites values to their shortest equivalent form, so background-color: white becomes background-color:#fff and color: #ff0000 becomes color:red, whichever is fewer bytes. It does not analyze which rules actually apply to any page — that's a separate job called "unused CSS removal" or tree-shaking, which needs your HTML and JavaScript to know what's dead weight, and this tool keeps every rule you wrote. One exception to comment removal: a "bang comment" starting with /*! is preserved deliberately, since that's the convention build tools use for license banners that must survive minification.
Where you'll run into it
- Shrinking a stylesheet before deploying it to production
- Reformatting a minified CSS file to read or edit it
- Cleaning up styles copied from a browser's inspector panel
- Standardizing formatting before reviewing a CSS diff
Frequently asked
Will minifying change how my page looks?
No. Only whitespace and comments are removed — every selector, property, and value stays exactly as written.
Does this support SCSS or LESS?
No, only plain CSS. Compile your SCSS or LESS to CSS first.
Is my stylesheet stored?
No. Conversion happens on the server for that one request only and nothing is kept afterward.
Will this remove CSS rules that my page doesn't actually use?
No. That's a different job — usually called "unused CSS removal" or tree-shaking — and it requires cross-referencing your CSS against the actual HTML and JavaScript to know which selectors ever match. This tool only removes whitespace and redundant syntax and shortens values to their smallest equivalent form; every rule you wrote comes out the other side, just more compact. If you need a comment to survive minification — a license banner, say — start it with /*! instead of /*, and it will be kept.