Code Comment Remover for Many Languages
Strips comments, and optionally blank lines and trailing spaces, from code in a chosen language such as JavaScript, Python, PHP, Ruby, Lua, SQL, SCSS, TypeScript, YAML or Markdown.
- Free
- No sign-up
- Works on any device
About Code Comment Remover for Many Languages
Pick a language and the tool scans the code token by token, so comment markers inside strings are left alone: a URL containing double slashes inside quotes survives. It knows line comments such as //, # and --, block comments such as /* */, nested block comments in Rust and Swift, Lua long brackets, Ruby =begin blocks, PowerShell <# #> and HTML comments in HTML and Markdown. Lines that only held a comment disappear entirely. JavaScript regex literals are recognised heuristically, and an option can keep /*! */ and @license comments.
How to use Code Comment Remover for Many Languages
- Choose the language so the right comment markers and string rules are used.
- Paste the code and choose how to treat blank lines and trailing spaces.
- Copy or download the cleaned code and compare it with your original before replacing it.
Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
Also known as
Frequently asked questions
Will it remove a comment marker that sits inside a string?
No. Quoted strings are skipped, so a URL such as http://example.com inside quotes stays intact. Python docstrings are strings, so they are kept too.
Can I keep license headers?
Yes. Tick the option to keep block comments that start with /*! or contain @license or @preserve, which minifiers usually keep as well. Other comments are still removed.
Which cases can confuse the scanner?
Heredocs, raw strings in some languages and regular expressions with unusual quoting can look like code or comments. Always check the result and test it before using it in production.
Is Code Comment Remover for Many Languages free?
Yes. Code Comment Remover for Many Languages on Toolipedia is free to use, with no sign-up and no watermark.
Is it safe to use?
Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.
Does it work on my phone?
Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.
Do I need an account?
No. Just open the page and use the tool. There's no sign-up and no email needed.