CSS Formatter / Minifier
Runs locally in your browser. Your input is not uploaded.Free, no sign-up
Input
Output
Format CSS, SCSS and Less, or minify CSS stylesheets.
How to use the CSS Formatter and Minifier
- Paste CSS, SCSS or Less and pick the Language, or click Sample.
- Choose the indentation; the formatted stylesheet appears instantly.
- Switch to Minify to shrink CSS for production and see how many bytes you save.
- Syntax errors, such as a missing closing brace, are shown with their line.
How minification works
- Whitespace and comments are removed;
/*! … */license comments are kept, as build tools do. - Values get shorter forms where they mean the same:
#ff0000becomesred,0pxbecomes0. - Merge and reorder rules also combines rules with the same declarations, e.g.
.a{color:red}.b{color:red}into.a,.b{color:red}. It's smaller but changes rule order, so it's off by default.
Frequently asked questions
Which tools does this use?
Formatting uses Prettier; minifying uses CSSO. Both run in your browser.
Can I minify SCSS or Less?
Not directly: variables, nesting and mixins must be compiled to CSS first. You can still format SCSS and Less here.
Is my stylesheet uploaded?
No. Everything happens in your browser.
Related tools
All tools- HTML FormatterFormat and minify HTML and check its basic structure.
- JavaScript Formatter / MinifierFormat JavaScript, JSX and TypeScript, or minify JavaScript, without executing it.
- Color ConverterConvert colors between HEX, RGB, HSL, HWB and OKLCH, and check their contrast.
- Regex TesterTest regular expressions with live match highlighting, capture groups, flags and explanations.
- Cron Expression GeneratorBuild Linux cron expressions with a visual editor and preview the next run times.