CSS Minifier & Beautifier
Minify CSS to reduce file size or beautify it for readability, instantly in your browser without altering what the stylesheet actually does. Clean up CSS exported from a design tool, read a minified file, or compare size before and after compression.
Usage examples
Shrinking a stylesheet before deploying
Paste a full stylesheet like '.container { padding: 20px; margin: 0 auto; }' and minify it to cut unnecessary whitespace and comments before shipping to production.
Reading a minified CSS file
Paste a one-line minified stylesheet you found in a browser's dev tools and beautify it into readable, indented CSS to understand what it does.
Cleaning up CSS exported from a design tool
Design tools often export CSS with inconsistent spacing and stray comments — beautify it into a consistent, readable format before adding it to your codebase.
Comparing file size before and after minifying
Paste in a large stylesheet and minify it to see roughly how many bytes you'll save on page load, which matters for sites tracking Core Web Vitals or page weight budgets.
Reviewing a teammate's CSS in a pull request
If a diff contains a single unreadable minified line, beautify it first so you can actually review the selectors and property changes line by line.
Frequently asked questions
Does minifying change what my CSS actually does?
No — minifying only removes whitespace and comments and uses the most compact punctuation. It never changes selectors, property names, or values, so the resulting styles behave identically to the original.
Will strings or url() values get mangled?
No. The tool tracks quoted strings and url(...) values (including unquoted and data: URLs) as opaque content, so characters inside them — including ; or /* that would otherwise look like CSS syntax — are left completely untouched.
Does this tool send my CSS anywhere?
No — everything runs locally in your browser. Your CSS is never uploaded to a server.
Does minifying remove CSS custom properties (variables)?
No. Custom properties like --primary-color: #333; are ordinary declarations as far as the parser is concerned, so they're preserved exactly — only the surrounding whitespace and any nearby comments are stripped.
What happens to comments like /* TODO */ when I minify?
All comments are removed during minification, since browsers ignore them anyway and they only add bytes. If you need to keep a comment for your own reference, hold onto an unminified copy of the source file.
Can I beautify CSS that has syntax errors?
The tool does its best to format whatever you paste, but it isn't a CSS validator — it won't catch mistakes like a missing closing brace or an invalid property. If the output looks wrong, check your original CSS for unbalanced braces or quotes first.
Does beautifying match my team's formatting style, like Prettier?
Beautifying reformats your CSS with consistent spacing and indentation, but it isn't a drop-in replacement for a configurable formatter like Prettier. If your project enforces specific formatting rules, run the result through your project's formatter afterward.