CSS Minifier
Reduce CSS file size by stripping comments and unnecessary whitespace. See how many bytes you save. Runs in your browser.
Reduce CSS file size by stripping comments and unnecessary whitespace. See how many bytes you save. Runs in your browser.
Minifying CSS removes comments and whitespace that browsers do not need. Smaller files download faster and help pages load quickly.
Paste your stylesheet, click Minify and copy the result. The note under the output shows how much smaller it is.
Minification reduces a stylesheet by deleting characters that do not affect how the browser parses it. Comments are removed, runs of whitespace and line breaks collapse, spaces around braces, colons and commas disappear, and the final semicolon before a closing brace is unnecessary because the brace already ends the declaration. These changes are lossless, so the cascade, specificity and rendering stay identical. Typical savings range from about 10 to 30 percent of the raw size, depending on how much commenting and indentation the source had.
Minification is separate from compression. Servers usually apply gzip or Brotli to text responses, and minified files compress slightly smaller still, but the two savings overlap, so the gain after compression is smaller than the gain before. Some whitespace must stay: the space in a descendant selector such as nav a, and spaces around plus and minus inside calc(). More aggressive optimizers also merge rules and shorten colors, which this tool intentionally does not do.
Yes. Spaces around operators inside calc() are kept, because CSS requires them.
No. It only removes comments and whitespace, so behaviour is unchanged.
For larger projects use a build-time minifier. This tool is handy for quick jobs.
No. It runs in your browser.
It should not. Only comments and unneeded whitespace are removed, so selectors and declarations are unchanged. Always preview the page, as invalid input stays invalid after minification.
Yes, they are accepted like any other CSS. Spaces that CSS requires, such as between media features and keywords, are kept. Check the output in your browser if the stylesheet uses unusual syntax.