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.

Comments stripped, functionality intact

Removes all CSS block comments without touching selectors, properties, or values. Reduce file size and protect internal developer notes from public-facing CSS.

100% Private
Files never uploaded
Always Free
No account needed
Instant Results
No upload wait time
No Limits
Batch process freely
Feature JustDownSize Others
Price Always free Paid plans
File uploads Never uploaded Sent to server
Daily limit Unlimited 5–20/day free
Account needed No signup Registration
Watermarks None, ever On free tier

Strip Comments from CSS Files

Block and Line Comment Removal

Removes all CSS comment blocks (/* ... */) from your stylesheet. Handles multi-line comments and inline comments equally.

File Size Reduction

Shows original and stripped file size. Comments in large CSS files — especially those generated from SASS or LESS preprocessors — can add 10–30% overhead to the file size.

Browser-Only Processing

CSS stripping runs in your browser. Your internal CSS comments containing developer notes, section markers, or proprietary logic never upload to a server.

One-Click Copy

Copy the comment-free CSS to clipboard with a single click.

Preserves Functionality

Only comments are removed. Selectors, properties, values, and all functional CSS remains intact and unchanged.

SASS and LESS Output Cleaning

Preprocessor-compiled CSS often contains source map comments, author annotations, and section markers intended only for development. Stripping before production deployment removes development artifacts.

Why Remove CSS Comments Before Deployment

Production CSS Optimization

CSS comment removal is one step in a CSS optimization pipeline. Comments serve no browser function — they add pure file size. Stripping before deployment reduces CSS payload and speeds delivery.

Proprietary Code Protection

Development CSS often contains comments explaining business logic, design decisions, or internal system references ('/* Updated for rebrand Q3 */,' '/* Fix for IE11 flexbox bug */). Stripping comments before publishing client-facing CSS prevents exposing internal notes.

CDN Asset Preparation

CSS files uploaded to a CDN should be optimized. Comment removal is faster than full minification and can be done selectively when you want to keep readable formatting but eliminate the comment overhead.

Legacy Code Cleanup

Older CSS files often contain commented-out rules, outdated section headers, and documentation blocks that were accurate years ago but no longer reflect the code. Stripping comments is part of a legacy CSS audit.

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.

Remove CSS Comments Online: Strip Comments Without Full Minification

Not every CSS optimisation task requires full minification. Sometimes you want a smaller file that's still readable — indentation intact, properties on separate lines — with only the comments gone. This tool does exactly that: paste your CSS, enable the comment options you want, and get clean output without collapsing your whitespace.

Block comments vs. line comments in CSS

The CSS specification only defines one comment syntax: block comments, delimited by /* and */. They can appear on a single line or span many lines, and can be placed anywhere whitespace is valid — between selectors, between declarations, even inside a property value in some contexts.

Line comments (// text) aren't part of the CSS spec, but they're common in Sass, Less, and PostCSS source files. They also appear in raw CSS that's been compiled from a preprocessor without full stripping. Modern browsers silently ignore them, but they're technically invalid and add unnecessary bytes. This tool removes both kinds.

How much do comments add to a stylesheet?

It depends on the team's documentation habits. A lightly commented stylesheet might carry 3–5% comment content by character count. A thoroughly documented one — with section headers, browser-hack explanations, and component notes — can reach 20–40%. On a 100 KB stylesheet, that's 20–40 KB of bytes that every visitor downloads on every page load and that the browser's CSS parser must process before any rendering begins.

The impact is larger on uncached first loads and for users on constrained mobile connections. Stripping comments is one of the cheapest optimisations available: the file gets smaller, the code behaviour doesn't change at all, and the source in version control stays as documented as you want it.

Comment removal vs. full minification

Full minification collapses all whitespace, removes comments, and produces a single-line file. That's appropriate for production deployments behind a build pipeline. But there are cases where you want the output to remain somewhat readable: you're reviewing a colleague's CSS, you're debugging a live site and need to keep properties on separate lines for DevTools readability, or you want a partially compressed file you can still diff in version control.

Removing comments without touching whitespace gives you a middle ground. You get the file size savings from the comments — often the largest single contributor to stylesheet bloat in documented codebases — without sacrificing readability. For the full treatment, run the result through a CSS minifier afterwards.

The other options in this tool

Empty line removal. Strips blank lines between rules and declarations. Doesn't affect functionality but reduces line count, which matters when file-size metrics count newlines as bytes (they do — a newline is 0x0A, one byte in UTF-8).

!important removal. Strips every !important declaration. Useful when inheriting a codebase that overused it and you're refactoring specificity. Use with caution — removing !important can change visual output if the cascade was relying on it.

Alphabetical property sorting. Reorders declarations within each rule alphabetically. This is a stylistic choice that some teams enforce via Stylelint's declaration-property-sort-order rule. Sorted properties make diffs smaller and rules easier to scan. The CSS formatter also offers this option alongside full pretty-printing.

When to use this tool in a workflow

The ideal workflow keeps commented source CSS in your repository and strips comments at deploy time via a build tool (webpack's css-loader, Vite's built-in PostCSS pipeline, or a Gulp task with gulp-strip-css-comments). If your project doesn't have that pipeline, this tool fills the gap.

It's also useful for one-off cleanup: you've received a CSS file from a vendor or a design handoff, it's full of notes that made sense during development, and you want a cleaner version to integrate into your project. Paste, strip, copy — the whole operation takes seconds.

For projects where you're also cleaning JavaScript, the same principle applies: comments in .js files add weight. The JS minifier handles both // and /* */ removal for JavaScript files in one step.

Licensed code and preserving copyright comments

Some CSS files include a license header at the top — typically a block comment containing the library name, author, version, and MIT or Apache license text. Stripping these comments is technically permissible under most open-source licenses only if the license is documented somewhere else (your LICENSE file, your package metadata, etc.). If you're distributing the minified CSS publicly and you've removed a license comment, confirm the original license terms allow that before publishing.

A common convention is to use /*! (exclamation mark after the opening) to mark comments as protected — build tools like UglifyCSS and clean-css respect this convention and preserve those comments even in aggressive minification mode. This tool strips all comments regardless; if you need license-comment preservation, check the advanced settings of your build tool instead.

Combining with full minification

Removing comments is the first step of full minification, not a replacement for it. A stylesheet with comments stripped but whitespace preserved is smaller than the original, but a fully minified stylesheet (no comments, no whitespace, no trailing semicolons) is smaller still. If file size is the priority, run the CSS minifier instead — it strips comments and compacts everything else in a single pass. Use this comment-only tool when you want a smaller file that's still readable in an editor or in browser DevTools.