Text UtilitiesText CleanersFree Tool

Remove Code Comments

Strip /* block */ and // line comments from code, plus the resulting blank lines — covers C-style comment syntax used by many languages.

How to Use Remove Code Comments
  1. 1Paste your code (C-style comment syntax)
  2. 2Click Convert
  3. 3Copy the code with comments removed
Frequently Asked Questions

/* block comments */ (including multi-line ones) and // single-line comments — the C-style syntax shared by JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, Swift, and CSS.

No — this tool only recognizes // and /* */ syntax. Python, Ruby, and shell scripts use # for comments, which this tool won't detect or remove.

No — HTML uses a different comment syntax not covered by this tool. Use the HTML Minifier tool instead, which does strip HTML comments.

No — the removal happens entirely in your browser.

Related Tools

Related Articles

More from Text Utilities