Why remove CSS comments from production code?
CSS comments are invaluable during development — they explain decisions, mark sections, and document browser hacks. But in production, every comment adds bytes that browsers must download and parse before rendering your page. Stripping them is a simple optimisation that costs nothing and improves performance.
Block comments vs inline comments
Standard CSS only officially supports block comments: /* this is a comment */. They can span a single line or many lines and appear anywhere whitespace is allowed. Inline comments (// like this) are not valid in CSS but are supported by preprocessors like Sass and Less, and occasionally appear in plain CSS where browsers happen to silently ignore them. Our tool handles both.
Comments and file size
Heavily documented CSS files can contain 20–40% comment content by character count. Stripping those comments before deployment reduces file size, improving download times — especially noticeable on slower mobile connections. When combined with gzip or Brotli compression on your server, the effect is amplified further.
Keeping a clean production build
Best practice is to maintain richly commented source CSS in your version control repository and strip comments as part of your build pipeline (webpack, Vite, Parcel, or a Gulp/Grunt task). For teams without a build system, this free online tool lets you strip comments manually before uploading files to your server — no configuration required.
Beyond comments: the other options
This tool also offers empty-line removal to reduce file length, full minification to collapse whitespace, !important removal for codebases that overuse it, and alphabetical property sorting for consistency. Each option is independent so you can apply exactly the transformations you need.