Minify CSS

Paste CSS to strip out comments and unneeded spaces so the file downloads faster. You see how much was saved, and nothing is uploaded.

How to use the CSS minifier

  1. Paste your CSS into the left box, or click Open File.
  2. The minified code appears on the right, with the size saving shown underneath.
  3. Click Copy or Download.

What minifying does

Code is written with spacing and comments so that people can read it. Browsers do not need any of that. Minifying removes it, which makes the file smaller, so pages load faster and use less data.

BeforeAfter
.button {
  color: #ffffff;
  padding: 8px 16px;
}
.button{color:#ffffff;padding:8px 16px}

What is removed

  • Comments
  • Line breaks and indentation
  • Spaces around braces, colons, semicolons and commas
  • The last semicolon in each rule

Is it safe?

Text inside quote marks and url(…) is never changed, and the spaces that matter in selectors and calc() are kept, so the page looks exactly the same. Keep your original file for editing and put the minified copy on your website.

Does minifying really help?

Typical savings are 15% to 30% for CSS and HTML and 30% to 60% for JavaScript. Smaller files mean quicker page loads, which helps visitors on phones and is one of the things search engines measure.

See also the HTML Minifier and the JavaScript Minifier.

Your data stays on your device

The conversion runs entirely in your web browser. Nothing you paste or open is sent to a server, so it is safe to use with customer lists, exports and other private data. There is no sign-up and no size limit beyond what your device can handle.

Frequently asked questions

How do I minify CSS?

Paste the code into the left box. The minified version appears on the right, ready to copy or download.

Will minified CSS still work?

Yes. Only characters the browser does not need are removed, so it behaves the same.

Can I turn minified code back?

You can add line breaks back with a formatter, but comments and original names are gone for good. Always keep your original file.

Is my code uploaded?

No. It is processed in your browser and never sent to a server.