CSS Comment Remover
Strip every /* comment */ from a stylesheet and keep everything else byte-for-byte intact — with a report of how many comments went and how much lighter the file got.
Settings
The CSS you need to build this yourself
Understand the output, not just copy it — these lessons on our learning path teach exactly what this tool automates:
Related generators & tools
- CSS Minifier & FormatterDeveloper Tools
- CSS Property SorterCode Quality
- CSS Gzip Size EstimatorCode Quality
- CSS Validator & Syntax CheckerValidators & Checkers
- CSS Diff CheckerCode Quality
How it works
CSS has exactly one comment syntax — /* … */, no // line comments — which makes removal a clean single pass: everything between the markers goes, including multi-line blocks and commented-out old code. Stray blank lines left behind are collapsed.
The /*! toggle honors the convention for legally required comments (license headers): build tools preserve them through minification, and so can this tool.
Run the code — try it yourself
Manually strip the three comments from this style block (keep the rules working) — then verify with the tool.
Frequently asked questions
When would I use this instead of the full Minifier?
When you want a readable file without the commentary — sharing a snippet, publishing an example, or trimming a vendored library while keeping its formatting.
Are // comments removed too?
They don't exist in CSS — a // line is invalid syntax the browser drops. Run the Validator if you suspect you have some.
Do comments inside strings break it?
A value like content: '/* not a comment */' is an edge case a regex pass can mis-handle — rare in practice, but check output if your CSS embeds comment-like strings.
Keep going
Comments are for the repo; production is for the wire. For the complete squeeze — whitespace too — continue to the CSS Minifier and weigh the result in the Gzip Estimator.
CSSmatic is a non-profit project, made by developers for developers.