Advertisement

CSS Minifier

Shrink CSS by stripping comments and extra whitespace — and see how many bytes you save.

Advertisement

How to Use This Tool

Paste your CSS, then minify. Copy the compact version into your build or a production stylesheet.

  • This is a simple comment and whitespace minifier — always test pages that rely on unusual spacing inside strings.
  • For production, pair this with Gzip/Brotli compression on your server.

Practical Example

Minify this snippet:

/* note */
body {
  color: red;
  margin: 0;
}

The output drops the comment and the spaces:

body{color:red;margin:0;}

What Your Results Mean

  • Minified CSS — the same rules with comments and extra spaces removed.
  • Saved bytes — the difference between the original and minified sizes.
  • Savings percent — the share of the file that was whitespace or comments.

Frequently Asked Questions

Is minified CSS safe?

Yes for typical stylesheets. Strings that depend on extra spaces (rare) could change — always preview.

Are comments removed?

Yes. Block comments of the form /* ... */ are stripped before whitespace is collapsed.

Does this rewrite selectors?

No. Selectors, properties and values stay as written; only comments and extra spaces go.

Is my CSS uploaded?

No — minification runs entirely in your browser.

How does this help performance?

Smaller files download and parse faster. Combined with compression, savings are often 20-40% on hand-formatted CSS.

Trusted Sources

Advertisement