Free · No sign-up · Runs in your browser

CSS Minifier

Shrink your stylesheets for production in one click. Merge rules, remove whitespace and comments, see exactly how many bytes you saved, then copy or download the .min.css file.

Ctrl + Enter
Input Paste, type or drop files
Output Minified code appears here
Original–
Minified–
Saved–
Gzipped–
Time–

Why developers use cssminify.org

Private by design

Minification happens in your browser. Your CSS is never uploaded, stored or logged.

Structural optimisation

Beyond whitespace removal: merges duplicate rules, shortens colors and values, and drops overridden declarations.

Combine many files

Drop several stylesheets at once. They are merged in order into a single .min.css file.

Real size stats

See original, minified and gzipped sizes side by side, so you know what your users actually download.

Beautify too

Need to read a minified stylesheet? One click turns it back into neatly indented CSS.

Free API

Minify from your build pipeline, CMS or Classic ASP app with one POST request. No key needed.

How to minify CSS

  1. Add your code. Paste it, type it, or drop one or more .css files onto the input box.
  2. Pick your options. The defaults are safe for production; open the options to fine-tune them.
  3. Minify and ship. Press Minify (or Ctrl + Enter), check how much you saved, then copy or download the .min.css file.

CSS Minify API

Automate minification from your build scripts, CI or CMS with a single HTTP request. No key required.

Endpoint
POST https://cssminify.org/api/
Body
input: your CSS (form-urlencoded)
Optional
format=json for sizes and savings, license=0 to also drop /*! */ comments
Returns
text/css with the minified code, or 400 and the error text
Limits
Up to about 200 KB per request, 30 requests per minute

The API uses our lightweight server engine (comment and whitespace removal). The browser tool above applies the full csso optimiser.

curl -X POST https://cssminify.org/api/ \
  --data-urlencode "[email protected]" \
  -o style.min.css

# sizes and savings as JSON
curl -X POST https://cssminify.org/api/ \
  --data-urlencode "[email protected]" -d format=json

Frequently asked questions

What does a CSS minifier do?

It removes everything the browser does not need to read your stylesheet: comments, line breaks, indentation and extra spaces. It also rewrites values in shorter forms, for example #ff0000 becomes red and 0px becomes 0. The result looks the same in the browser but downloads faster.

Is it safe to use the minified CSS in production?

Yes. The default settings only apply transformations that keep your page looking exactly the same. If you rely on a very unusual cascade trick, untick Restructure to keep the original rule order.

Is my CSS uploaded to your server?

No. With JavaScript enabled, everything runs locally in your browser. Only if JavaScript is turned off does the form fall back to our server, which minifies the code in memory and does not keep it.

How much smaller will my CSS get?

Typically 15 to 40 percent before compression, depending on how much whitespace, how many comments and how many duplicate rules your stylesheet has. The stats panel shows the exact saving and the gzipped size.

Will license comments be kept?

Yes. Comments that start with /*! are kept by default, because licenses often require it. Untick Keep /*! comments to remove them too.

Can I minify several CSS files into one?

Yes. Select or drop several .css files and they are combined in the order you added them. You can remove any file from the list before downloading.

Can I undo minification?

Comments and your original formatting cannot be recovered, but the Beautify button reformats minified CSS with indentation and line breaks so it is easy to read again.

Minifying JavaScript too? Use our sister tool jsminifier.org, powered by Terser, with name mangling, dead-code removal and ES2024 support.