🧹Code Comment Remover

Detect and strip comments (//, #, /* */, etc.) from source code across common languages

How to Use the Code Comment Remover

When sharing code with someone else or pasting it into documentation, leftover development comments can make it look messy or leak information you didn't mean to share. Paste your code, choose the comment style for the language you're using, and this tool automatically detects and removes //, #, /* */, and <!-- --> style comments, leaving only clean code behind.

The "Auto-detect" mode conveniently handles several languages' comment styles at once, but because it relies on regular expressions, a pattern that happens to look like // or # inside a string literal could be removed unintentionally. If you know exactly which language you're working with, picking that specific style gives more accurate results.

The cleaned-up result appears in a separate output box, along with the character count before and after, so you can see at a glance how much comment text was removed.

Frequently Asked Questions

Does it also remove // or # inside strings?

Since this uses regular expressions, some edge cases like symbols inside string literals may not be distinguished perfectly. We recommend reviewing the result before pasting it elsewhere.

Can it handle a mix of languages at once?

Selecting "Auto-detect" processes HTML, CSS, JS, and Python comment styles all at once. If you know exactly which language you're using, picking that specific style gives more accurate results.