CSS Minifier

Compress CSS for production, or expand minified CSS back into readable form.

Paste CSS to minify it.


Result will appear here.

, Original
, Minified
, Saved
, Rules

Features

  • Comment and whitespace removal
  • Optional zero-value and hex-colour shortening
  • Beautify mode for reading minified CSS
  • Byte-level savings report
  • Preserves strings and url() contents

How to use it

  1. Paste your CSS into the input box.
  2. Choose which optimisations to apply.
  3. Press Minify, or Beautify to expand it again.
  4. Copy or download the result.

What minification actually saves

CSS minification typically removes 20% to 35% of the raw bytes, mostly whitespace and comments. But it is worth being clear-eyed about the real benefit: if your server sends CSS with gzip or brotli compression enabled, and it should, much of that saving already happens automatically, because repeated indentation and long runs of spaces compress extremely well. Minifying before compressing usually yields a further 5% to 15%, which is worth having but is not transformative.

The safe optimisations are unambiguous. 0px can become 0 in most contexts, since the unit is meaningless at zero. #ffffff can become #fff when the pairs repeat. A leading zero in 0.5em is optional. The final semicolon in a block is redundant. None of these change behaviour.

Two caveats. Zero without units is not always safe, inside flex-basis and in some calc() expressions a unit is required, and stripping it breaks the rule. And minifiers must not touch the inside of strings or url() values, where whitespace and case can be significant. This tool protects those regions, but the general principle applies: always test a minified stylesheet before shipping it, rather than assuming byte-identical rendering.

Frequently asked questions

Yes, completely. CSS Minifier is free with no usage limits, no account and no sign-up. There is no paid tier and no trial that expires. Tools marked Premium on this site carry that label to indicate a deeper feature set, not a price.
CSS Minifier covers comment and whitespace removal, optional zero-value and hex-colour shortening, beautify mode for reading minified CSS, among other things. Everything is available immediately with no account, no sign-up and no usage limit.
CSS minification typically removes 20% to 35% of the raw bytes, mostly whitespace and comments. But it is worth being clear-eyed about the real benefit: if your server sends CSS with gzip or brotli compression enabled, and it should, much of that saving already happens automatically, because repeated indentation and long runs of spaces compress extremely well. Minifying before compressing usually yields a further 5% to 15%, which is worth having but is not transformative.
Everything is processed in your browser. Code, tokens and payloads you paste in never leave your device, which matters when you are debugging something that contains real credentials or customer data. Check the Network tab if you want to confirm it. Because nothing depends on a server, the tool also keeps working offline once the page has loaded, the site registers a service worker that caches it after your first visit.

Related tools

Further reading

📖 CSS Minification: How Removing Whitespace Speeds Up Your Site

Read the full guide on the 123MiniApps blog.

Pick a theme

Ten hand-tuned palettes.