CSS Minifier

CSS Minifier

Minify and prettify CSS online for cleaner output and faster front-end delivery.

Input

CSS Output

About The CSS Minifier

This free online CSS Minifier compresses stylesheet snippets by removing comments and unnecessary whitespace while preserving quoted strings and common CSS math spacing. It is useful for compacting small components, copied theme rules, inline stylesheets, and sanitized examples.

Processing runs locally in your browser. The tool also includes a Prettify mode that expands minified CSS into a readable block for review and editing.

How to Minify CSS Online

  1. Paste your stylesheet into CSS input.
  2. Click Minify to create compact CSS output.
  3. Use Prettify when you want readable indentation for review.
  4. Click Load sample to test the tool with a realistic stylesheet snippet.
  5. Click Copy Output to reuse the result.

Choosing Options Correctly

Minify vs Prettify:
- Use Minify when you want a smaller copied stylesheet snippet.
- Use Prettify when CSS is hard to inspect or needs manual editing.
- Test important output in your page or build workflow before deploying it.

Common Use Cases

  • Compress a CSS component before pasting it into a CMS, email template, or inline style field.
  • Clean up copied CSS by switching between compact and readable output.
  • Prepare sanitized CSS examples for tickets, documentation, or testing.
  • Review small stylesheet fragments without running a full build pipeline.

Quick FAQ

Is this the same as a production CSS optimizer?
No. It removes simple whitespace and comments, but it does not replace PostCSS, cssnano, bundlers, or browser-targeted optimization.

Will it remove CSS comments?
Yes, normal comments may be removed. Keep license comments separately if your project requires them.

Does it handle calc() spacing?
It should avoid unsafe changes, but complex CSS should still be tested in the target browsers.

Is my CSS uploaded?
No. CSS minification is designed to run in the browser.