CSS Minifier
100% PrivateDeveloper ToolsMinify CSS safely by removing comments and wasted space without changing what it does.
Runs entirely in your browser. Your input is not uploaded to Ovatly or anywhere else.
- 1Paste your CSS into the input box.
- 2Press Minify CSS.
- 3Check the size report: characters in, characters out and the percentage saved.
- 4Copy or download the minified CSS.
Input: body { margin: 0; padding: 0; } Output: body{margin:0;padding:0} Descendant selectors keep their meaningful spaces: .nav ul li { margin: 0 10px; } becomes .nav ul li{margin:0 10px}, and calc(100% - 20px) keeps the spaces around the minus sign, which CSS requires.
- This is a careful whitespace and comment minifier. It does not rename classes, merge rules or remove unused CSS, so savings are smaller than a build pipeline like Lightning CSS would give.
- Strings and url(...) values, including data URIs, are copied verbatim and never reshaped.
- Spaces inside calc(), min(), max() and clamp() are preserved where the CSS specification requires them.
For ordinary stylesheets, yes: comments and redundant whitespace have no effect on rendering. As with any minifier, test critical pages once after switching, especially if your CSS uses unusual hacks.
About this tool
The CSS Minifier shrinks stylesheets by removing comments, collapsing whitespace and dropping spaces around punctuation, while protecting strings, data URIs and calc() expressions that break if their spaces are touched. It reports the exact size saving so you can see whether the minified file is worth shipping.
Related tools
Part of Ovatly's free tools in Developer Tools.