Skip to content
Convertto

Code Comment Remover

Strip comments from six language families without breaking string literals.

Removing comments from code is harder than deleting everything after a marker, because "//" inside a URL string and "#" inside a quoted value are not comments. This tool scans character by character while tracking string state, so literals survive intact — and it can preserve a licence header.

Runs in your browser
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Should I strip comments before deploying?

Your minifier already does, as part of the build. Doing it to the source is destructive and loses the explanation of why the code is the way it is — which is the part future readers most need.

How to use the code comment remover

  1. 1Enter or paste your code.
  2. 2Choose the language.
  3. 3Turn "Remove the blank lines left behind" on or off as needed.
  4. 4Turn "Keep licence headers" on or off as needed.
  5. 5The result appears immediately — copy or download it.

Embed this tool

Put the working code comment remover on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More developer tools