CSS Minifier Logo
Developer Tools Embed Tool

CSS Minifier

Paste CSS and shrink it by removing comments and empty rules, collapsing whitespace and dropping the last semicolon in each block, with the original and minified sizes and the percentage saved.

0
Uses
—
Verified
Open
Access
Nov 2026
Added
Back to Directory

CSS Minifier

Paste CSS and shrink it by removing comments and empty rules, collapsing whitespace and dropping the last semicolon in each block, with the original and minified sizes and the percentage saved.

Auto-saved on this device

The minifier reads your CSS the way a browser does: strings, url(...) values and calc() spacing are never touched. It does not merge selectors, reorder rules or rename anything. Large files (up to 2 MB) work, and nothing is uploaded, so your CSS stays on your device.

Found a Bug or Missing a Feature?

Report any problems or suggest new features you want. You can write in English, Urdu, Hindi, or any language! Our AI will analyze your feedback and upgrade the tool.

About This Tool

Paste CSS and shrink it by removing comments and empty rules, collapsing whitespace and dropping the last semicolon in each block, with the original and minified sizes and the percentage saved.


Every byte of a stylesheet travels to every visitor before the page can be painted, because the browser will not render until it has read the CSS. Comments, indentation and blank lines help you and do nothing for the browser. A minifier removes them. Paste a stylesheet here and see what comes out, byte for byte.

What the numbers look like on a real file

The Try Demo button loads a small stylesheet of 433 bytes with a licence comment, a normal comment, two empty rules and some spaced-out declarations. The minified version is 277 bytes, a saving of 36 percent, and the result panel lists how many comments and empty rules went. Real files vary a lot. A hand-written, well-spaced file shrinks the most, and one that was already compressed by a build tool barely changes.

Minify and gzip are different savings

Most servers also compress text with gzip or Brotli, and that squeezes repeated whitespace very well. So the saving you see on the wire is smaller than the saving in the editor. The tile labelled gzip size compares the compressed size of your original with that of the result, when your browser supports it, so you can judge the real gain. Minifying still helps: the browser has less text to parse, and the compressed file is smaller too.

What is safe, and what the tool will not touch

The reader walks the file the way a browser does. Strings, url(...) values and data URIs are set aside first, so a comment-looking sequence inside a string survives. Spaces inside calc() stay, because calc(100% - 10px) breaks without them. The descendant selector a :hover keeps its space, since it differs from a:hover. Licence comments that start with /*! are kept by default. The tool never merges selectors, reorders rules or renames anything, so the cascade stays exactly as you wrote it.

Optional shortening

Two checkboxes go a little further. "Shorten colours" turns #FFFFFF into #fff, and #AABBCC into #abc, and writes font-weight:bold as 700. If you want to check what a colour code means before shortening it, the Hex to RGB Converter shows its channels. "Shorten 0px and 0.5" writes 0px as 0 and 0.5em as .5em, and skips values containing calc(), min(), max() or clamp(), where a unitless zero would be invalid. Untick both for the plainest result.

Warnings, files and beautify

If braces do not match, the page warns you and closes the open blocks in the output, which usually points to a typo such as a missing closing brace. You can open a .css file, drag one onto the box, or paste a block that still has its style tags: the tags are stripped and you are told so. The Beautify button does the opposite job, taking a minified line and laying it out again with one declaration per line, comments included. Large files up to 2 MB work. If your CSS references fonts or images with unusual characters in their paths, the URL Encoder Decoder helps you fix the addresses, and the HTML Entity Encoder Decoder helps when a content string needs escaping.

Keep your readable source file and publish the minified copy, ideally named .min.css. The Download button uses that name for you.

Questions people ask

How much smaller will my CSS get?

It depends on how it is written. Spaced-out, commented code often shrinks by 20 to 40 percent before compression. Already compact files shrink very little.

Will minifying change how my page looks?

It should not. The tool only removes whitespace, comments and empty rules, plus optional safe shortenings. Always test the result before publishing.

Does it keep licence comments?

Yes, comments that begin with /*! are kept by default. Untick the option to remove them too.

Why does it leave spaces inside calc()?

The plus and minus operators in calc() need spaces around them. Removing them would make the value invalid.

Is my CSS uploaded?

No. Everything runs in your browser, and only the settings and saved items are stored locally on your device.