Code Quality · Free CSS tool

CSS Comment Remover

Free · no sign-up Live preview · copy or download the CSS

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

Results appear here.
Generated CSS — updates live

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:

  1. CSS Minifier & FormatterDeveloper Tools
  2. CSS Property SorterCode Quality
  3. CSS Gzip Size EstimatorCode Quality
  4. CSS Validator & Syntax CheckerValidators & Checkers
  5. 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.

exercise.html — editable

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.