CSS Minifier

Removes comments, whitespace, and extra characters from CSS to shrink file size before you ship it. Fast, free, and built for simple browser-based workflows.

Instant
Processing
Private
Browser First
Free
No Signup

CSS Minifier

Popular

Paste your CSS above, then click Minify CSS.

Advertisement

728 x 90 In-Content Ad

About This Tool

CSS Minifier is a free online tool that strips comments, whitespace, and unnecessary characters from a stylesheet to make it smaller. Paste your CSS, click Minify CSS, and get back the same styles in far fewer bytes -- nothing to install and nothing uploaded to a server.

It's useful right before you deploy a stylesheet that grew large during development, when a build pipeline doesn't include a CSS step, or when you're pasting styles into a CMS that charges for every kilobyte of page weight. It also helps when auditing a page's load time -- pasting in an unminified file shows exactly how much of it was whitespace and comments versus actual rules. Beyond whitespace, it also drops the last semicolon in each block and trims leading zeros, so 0.5em becomes .5em. Minifying works alongside the gzip or Brotli compression most web servers already apply rather than replacing it: the server compresses whatever file it is given, so starting from a smaller file usually means a smaller download too.

Everything runs inside your browser, so your stylesheet is never uploaded to a server. That matters if the CSS belongs to a client project under NDA, an unreleased design, or anything else you'd rather not paste into a site you don't control. Treat the minified file as a build output rather than something to edit: keep your readable original as the working copy and minify a fresh copy each time you publish. If you ever need to read a minified file again, the CSS Beautifier tool restores the indentation, although comments that were stripped out cannot be brought back.

Shrinks CSS by stripping comments, extra whitespace, and unneeded semicolons
Keeps licence comments intact when you tick "Keep /*! important */ comments"
Shortens hex colours automatically, e.g. #ffffff to #fff, when enabled
Leaves quoted strings and url() values untouched so nothing inside them breaks
Shows the exact character count saved and percentage reduction after each run
Copy or download the minified CSS as a .css file

How to Use CSS Minifier

1

Paste your CSS

Drop your stylesheet into the CSS to Minify box.

2

Choose your options

Tick Keep /*! important */ comments to preserve licence headers, and Shorten hex colours to compress values like #ffffff down to #fff.

3

Click Minify CSS

The result appears below, along with the exact character count before and after and the percentage saved.

4

Take the result

Use Copy for the clipboard or Download to save it as minified.css. Clear resets both boxes.

Frequently Asked Questions

Is this tool completely free?

Yes! All our tools are 100% free to use with no hidden costs, no registration required, and no credit card needed.

Is my data safe and private?

Absolutely. All tools run entirely in your browser (client-side). Your data never leaves your device and is not sent to our servers.

Can I use this tool offline?

Yes, once the page is loaded, the tool will continue to work even if you lose internet connection since it runs in your browser.

Is there a character limit?

There is no strict character limit, but very large amounts of text (100,000+ characters) may slow down your browser.

Can I use this for commercial projects?

Yes! All our tools are free for both personal and commercial use.

Does CSS Minifier change how my styles work?

No. It only removes comments, whitespace, and redundant characters -- selectors, properties, and values are untouched, and quoted strings and url() values are protected so nothing inside them gets mangled.

What does the /*! important */ comment option do?

Some CSS comments start with /*! to mark them as a licence or attribution notice that tools should not strip. Ticking "Keep /*! important */ comments" preserves any comment written that way while removing all others.

Will shortening hex colours change how they look?

No. #ffffff and #fff render identically in every browser -- shortening only applies when both characters in each colour pair match, so nothing is approximated or rounded.

How much smaller will my CSS get?

It depends on the original file. A stylesheet formatted with indentation and comments for readability commonly shrinks 20-40%; a file that is already dense will save much less.

Can I minify CSS with @media queries or CSS variables?

Yes. The minifier works on the raw text of the stylesheet, so at-rules, custom properties, nested selectors, and any other valid CSS syntax pass through and get compressed the same way as regular rules.

Does this tool validate my CSS?

No, it only compresses what you paste in. If your CSS has a syntax error, the minifier will not catch it -- check the output visually or run it through a validator first if you need to confirm it is error-free.