How to use the CSS Minifier
Step 1: Paste your CSS into the input box, or press Load example.
Step 2: Decide whether to keep licence comments that start with /*!.
Step 3: Press Minify CSS. The compact stylesheet appears in the output box.
Step 4: Check the original size, minified size and percentage saved.
Step 5: Press Copy output, or Download to save styles.min.css.
Features and benefits
Safe by design
Only comments and whitespace are removed. Values, units and colours are left exactly as written.
Strings and URLs protected
Text inside quotes and url() is never touched, so content strings and data URIs survive intact.
calc() aware
Required spaces around operators inside calc() are kept.
Licence comments
Keep /*! ... */ banners if your licence requires them, or strip everything.
Size report
See the original size, minified size, bytes removed and percentage saved.
What is removed, and what is not
The minifier deletes comments, collapses runs of spaces and line breaks, removes spaces around braces, colons, commas and combinators where this is safe, and drops the final semicolon before each closing brace. It deliberately does not shorten colours, strip units such as 0px, merge rules or reorder anything, because such optimisations can change behaviour in edge cases. The result is lossless: the browser sees exactly the same rules.
How much will it save?
Well-commented, generously formatted stylesheets often shrink by a quarter to a half, while CSS that is already compact saves little. Keep in mind that hosts such as Cloudflare Pages also compress text files while sending them, so the real-world saving over the network is smaller than the raw percentage suggests. Minifying is still worthwhile because smaller files parse faster and compress even further.
Good practice
Always keep your readable source file and treat the minified file as a build output. If you use a framework with a build step, it probably already minifies your CSS, and you will not need to do it by hand. This tool is ideal for standalone stylesheets, snippets and quick experiments.
Example use cases
Shipping smaller stylesheets
Reduce the size of hand-written CSS before deployment.
Quick checks
See how much a stylesheet could shrink without setting up a build tool.
Email and embedded CSS
Compact style blocks for places with size limits.
Learning
Compare formatted and minified output side by side.
Frequently asked questions
Is minifying CSS safe?
This tool only removes comments and whitespace, which does not change how browsers interpret the rules. Test the result as you would any deployment.
Will it break calc() or data URIs?
No. Spaces inside calc() that are required by the CSS specification are kept, and url() contents and quoted strings are never modified.
Why doesn't it shorten colours or remove units?
Those changes are not always safe and can alter behaviour in edge cases, so the tool sticks to lossless whitespace and comment removal.
Can I get my original formatting back?
Not from the minified output. Always keep your source file.
Does minifying CSS improve SEO?
Smaller files can help pages load faster, and speed is one of many things that affect user experience. There is no guarantee of a ranking change.
Related tools
Useful guides
Last updated 7 November 2026.