CSS Minifier & Beautifier
Minify or beautify CSS in your browser.
How to use
- 1 Paste your CSS into the input panel.
- 2 Choose Minify to compress, or Beautify to expand and indent.
- 3 Review the transformed output on the right.
- 4 Copy the result or download it as a .css file.
About CSS Minifier & Beautifier
The CSS Minifier & Beautifier compresses your stylesheets for production and expands minified CSS back into readable, indented code for editing.
Minifying strips comments and collapses every run of insignificant whitespace while leaving the meaning of your rules untouched — the output is byte-for-byte smaller but renders identically.
That matters because every kilobyte of CSS your visitors download is a kilobyte they wait for, and hand-minifying is tedious and easy to get wrong.
The minifier is string-aware: it understands the difference between a comment and a comment-like sequence inside a quoted value or a url() token, so declarations such as content: "/* not a comment */" survive intact.
Combinators, commas and braces lose their padding, and the redundant final semicolon before each closing brace is dropped.
The beautifier does the reverse — one declaration per line, two-space indentation, nested at-rules like media queries indented a level deeper — turning a wall of compressed CSS into something you can actually read and edit.
As with every My Tools Garage tool, all of this happens locally in your browser.
Your stylesheets, including any private design-system tokens or unreleased components, are never uploaded to a server.
Paste a file, toggle between Minify and Beautify, and copy or download the result.
FAQ
Does minifying change how my CSS renders?
No. Minifying only removes comments and insignificant whitespace, and drops the redundant final semicolon in each block. The rules are semantically identical, so the page looks exactly the same.
Are comments inside string values removed?
No. The minifier is string-aware and skips over quoted values and url() tokens, so a sequence like content: "/* x */" is preserved untouched.
Is my CSS uploaded anywhere?
No. Everything runs in your browser using JavaScript. Your stylesheet never leaves your device.