CSS Minifier & Beautifier
Minify CSS to reduce file size or beautify it for readability. Removes comments, collapses whitespace, shortens hex colors, and strips unnecessary units. Everything runs in your browser.
Optimizations Applied
Remove Comments
Strips all /* */ block comments
Collapse Whitespace
Removes unnecessary spaces, newlines, and tabs
Shorten Hex Colors
#ffffff → #fff, #aabbcc → #abc
Remove Zero Units
0px → 0, 0em → 0, 0rem → 0
Shorten Decimals
0.5 → .5, 0.75 → .75
Remove Trailing Semicolons
Last property before } doesn't need ;
Remove Empty Rules
Strips selectors with no declarations
Trim Selectors
Removes spaces around >, ~, + combinators
Frequently Asked Questions
What is CSS minification?
CSS minification removes unnecessary characters like whitespace, comments, and redundant semicolons without changing the stylesheet's behavior. This reduces file size, which means faster downloads and improved page load times. Typical savings range from 20-50% depending on the input.
Will minification break my CSS?
No. The minifier only removes characters that have no effect on how browsers interpret your CSS. Whitespace inside strings and required spaces (like between values) are preserved. The output is semantically identical to the input.
How much can I save by minifying CSS?
Savings depend on how much whitespace and comments your CSS has. Well-commented development CSS typically sees 30-50% reduction. Already compact CSS may only see 10-15%. The tool shows you the exact byte savings and percentage after minifying.
Is my CSS data safe?
Yes. All processing happens entirely in your browser using JavaScript. No CSS code is sent to any server. You can safely minify proprietary stylesheets and design system tokens.