CSS Minifier & Beautifier
Minify CSS to shrink it or beautify it for readability — string-safe, 100% in your browser.
About CSS Minifier & Beautifier
Switch between Beautify and Minify. Minify removes comments and unnecessary whitespace (and the last semicolon in each block) to shrink your CSS for production, showing the byte savings. Beautify reformats messy or minified CSS with one declaration per line and consistent indentation.
The processor is string- and comment-aware, so semicolons or braces inside url() and content values are never mangled. Everything runs locally in your browser; nothing is uploaded.
How to use CSS Minifier & Beautifier
- Paste CSS and choose Beautify for readable output or Minify for a smaller representation.
- Review the result and byte savings, then test the stylesheet in the page that uses it.
Limitations and common mistakes
Formatting does not prove a stylesheet is valid for every browser. New CSS syntax, custom properties and context-sensitive whitespace deserve a visual check.
Keep the original stylesheet in source control. A smaller file is useful only if selectors, values and cascade behavior remain correct.
The tool processes its input locally on your device. Read our privacy policy for analytics, storage and network details.
Minify a rule
.card,.btn { display: flex; color: #fff; }.card,.btn{display:flex;color:#fff}Beautify reverses it into a readable, indented form.
Frequently asked questions
Will it break url() or content values?
No. The minifier and beautifier track strings and comments, so semicolons, braces and spaces inside url() and content strings are preserved exactly.
What does minifying actually remove?
Comments, redundant whitespace and the final semicolon before each closing brace — the safe, lossless reductions that shrink file size.
Can it reformat already-minified CSS?
Yes. Beautify expands minified CSS into one declaration per line with indentation.
Is my CSS uploaded anywhere?
No. All processing happens locally in your browser.
For related tasks, explore JSON Formatter and XML Formatter. Their guides explain the different inputs, assumptions and output formats.