← All free tools Developer tools

CSS minifier

Minify your CSS by removing all the unnecessary characters.

About this tool

The CSS minifier makes stylesheets smaller without changing how they work. It removes comments, spaces and line breaks, and shortens values where it safely can, then shows how much it saved.

How to use the CSS minifier

  1. Paste your CSS.
  2. Press Minify.
  3. Copy the minified CSS into your site, or into a .min.css file.

What minifying does

  • Removes comments and all the whitespace that’s only there for people to read.
  • Drops the last semicolon in each rule and other characters CSS doesn’t need.
  • Shortens values: #ffffff becomes #fff, and 0px becomes 0.

For safety, it never fetches files: @import rules and url() references are left as they are, not pulled into the result.

Why it matters

CSS blocks the page from showing until it has downloaded, so a smaller stylesheet means the page appears sooner, which helps visitors and Core Web Vitals. Keep your readable CSS as the original, and minify a copy for the live site. If the minifier reports an error, the CSS has a syntax problem, often a missing brace or quote, worth fixing anyway.

Have a project in mind?

Have a brand or a product to grow?