Small Tools
Frontend utility

CSS Minifier

Remove comments and formatting whitespace from CSS.

● This tool runs entirely in your browser. Your input is never uploaded to our servers.
Output
Your result will appear here…

How to use CSS Minifier

  1. Paste your CSS.
  2. Select Minify.
  3. Review the result before you use it in production.

Example

Input / settings:

.card {
  color: #333;
  padding: 1rem;
}

Output:

.card{color:#333;padding:1rem}

The semicolon before the closing brace is dropped. Values such as #333 are left as written.

When to use

Overview

CSS Minifier removes comments and whitespace from a stylesheet with a lightweight tokenizer, not a full CSS parser. It keeps comments that start with /*!, leaves strings and url() contents exactly as written, drops the last semicolon in each rule, and keeps a space only where CSS needs one. It does not shorten colors or values, merge rules or check that the CSS is valid.

Supported input

CSS text

Output details

minified CSS

Common mistakes

Practical tips

Privacy and security

This tool runs entirely in your browser. Your input is never uploaded to our servers. Minification runs locally and only removes comments and whitespace; nothing is uploaded. Inside calc() and other parentheses the spaces around + and - are kept, because CSS requires them: calc(100% - 20px) stays as written.

References

Frequently asked questions

Does CSS Minifier shorten colors or merge rules?

No. It only removes comments and unneeded whitespace. Colors, units and rules are written back as they were.

Why was my license comment removed?

Only comments that begin with /*! are kept. Start the comment that way if it must stay in the output.

Is calc() safe to minify here?

Yes. Spaces around + and - inside parentheses are preserved, so calc(1px + 2px) keeps its meaning.

Related tools