100% Free In-browser Instant clean

Remove CSS Comments Free Online

Strip block comments, inline comments, empty lines and more from your CSS instantly. Paste your code or upload a .css file — all processing happens in your browser, your code never leaves your device.

Drop a .css file here or click to browse
Options
Never uploaded · How it works

Remove CSS comments in 3 steps

1

Paste or upload

Paste your CSS into the input box, or drop a .css file directly onto the upload zone above.

2

Choose options

Select which comment types and extras to remove. Processing runs instantly as you type or adjust options.

3

Copy or download

Copy the cleaned CSS to your clipboard or download it as a .css file ready to deploy.

Frequently asked questions

This tool removes two types of CSS comments: block comments (/* … */), which are the standard CSS comment syntax and can span multiple lines, and inline comments (// …), which are not valid in standard CSS but appear in SCSS/Sass source files and some pre-processors. You can enable or disable each type independently.

No. CSS comments are ignored by browsers and have no effect on how styles are applied. Removing them is entirely safe. The only exception is license comments (often starting with /*!) which some tools preserve intentionally — if you need to keep those, consider using the minifier which has license-comment preservation built in.

No. All processing runs entirely inside your browser using JavaScript. Your CSS is never transmitted to any server and never leaves your device. This makes the tool safe for private, proprietary, or client CSS.

When enabled, the declarations inside each CSS rule block are sorted in alphabetical order by property name. For example, margin would move before padding. Alphabetically sorted CSS is easier to scan and can slightly improve gzip compression ratios. The selectors and rule order remain unchanged.

Yes, partially. The comment stripping logic works on any plain text and will correctly remove /* */ and // comments from SCSS or Less source. However, SCSS/Less-specific syntax (nesting, variables, mixins) is not reformatted or validated — the tool only operates on comments and whitespace.

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.