Free text tools — updated for 2025 | All Text Tools

CSS Minifier

Compress CSS by removing comments and collapsing whitespace. See the exact byte savings before you deploy.

CSS Minifier

What CSS minification removes

  • Block comments (/* … */) — Developer notes and section headers invisible to the browser. Often 5–20% of a stylesheet.
  • Whitespace and newlines — Spaces, tabs, and newlines between selectors and declarations. Browsers ignore them; HTTP bytes do not.
  • Spaces around operators — Spaces before and after {, }, :, ;, and , are removed where safe.
  • Trailing semicolons — The last ; before a closing } is optional in CSS and can be safely removed.
  • /*! … */ kept — Important comments (license headers, IE hacks) are preserved by default. Uncheck to remove everything.

Tip: CSS minification is especially valuable for large stylesheets with significant whitespace. Combined with gzip on your web server, you typically get 80–90% size reduction on CSS files.

Frequently Asked Questions

Yes. CSS is whitespace-insensitive outside of strings. Removing comments, collapsing whitespace, and stripping trailing semicolons before } are all safe operations — the browser parses the result identically to the original. The only edge case is content inside content: "…" strings, which this tool preserves untouched.
For production projects with a build pipeline, tools like PostCSS + cssnano or Lightning CSS perform deeper optimizations (shorthand merging, vendor prefix removal, value normalization). This tool is ideal for quick one-off compressions, reviewing a library's CSS, or projects where a build tool isn't set up. It handles 95% of real-world use cases with zero configuration.