Home / Tools / Comment Remover

CSS & HTML Comment Remover

Strip all comments from your code in one click. Clean, minify, and optimize — without touching a single line of your actual code.

One-Click Clean Code-Safe 100% Private
Original Code With Comments
Cleaned Code Comments Removed

Why Remove Comments?

Comments are great for development — but they hurt your production code.

Slower Page Load

Every comment byte is downloaded by your visitors' browsers. A bloated CSS file with hundreds of comment lines can add 50-200KB of useless weight to every page load.

SEO & Core Web Vitals

Google penalizes slow sites. Bloated code hurts your LCP and FID scores, pushing your rankings down. Clean code = faster rendering = better SEO.

Harder to Read

Old comments like /* fix this later */ or <!-- TODO --> confuse other developers. Removing them makes your codebase cleaner and more professional.

Manual Removal Is Risky

Using Find & Replace to delete comments often breaks your code. You accidentally remove a <div> or a CSS rule. This tool removes only the comments.

One Click. Zero Risk. Instant Results.

Paste your code. Click "Remove All Comments". Get clean, production-ready code — with your actual logic 100% untouched. See exactly how many bytes you saved.

Smart Parsing

Correctly handles nested comments, comments inside strings, and multi-line blocks — without breaking your code.

Instant & Local

Runs 100% in your browser. No uploads, no servers, no waiting. Your code never leaves your device.

Size Savings Report

See exactly how many characters and what percentage you saved — perfect for tracking optimization progress.

How to Use

1

Paste Your Code

Copy your CSS or HTML with comments and paste it into the left box.

2

Choose & Click

Pick "CSS Only", "HTML Only", or "Remove All" and click the button.

3

Copy Clean Code

Your cleaned code appears on the right. Copy it and use it anywhere.

Frequently Asked Questions

Will this break my code?

No. The tool only removes text between /* */ (CSS) and <!-- --> (HTML). Your actual selectors, properties, tags, and attributes are completely untouched.

Does it handle comments inside strings?

Yes. The parser is smart enough to ignore comment-like text inside quoted strings (e.g., content: "/* not a comment */"), so your code stays intact.

Is my code uploaded anywhere?

Absolutely not. Everything runs locally in your browser using pure JavaScript. Your code never touches a server.

What's the difference between CSS and HTML comments?

CSS comments use /* ... */ syntax. HTML comments use <!-- ... --> syntax. This tool can remove either one — or both at once.

Clean your code now

Remove comments, reduce file size, and speed up your site — in one click.

Open Comment Remover