Remove line and block comments from JavaScript while preserving URLs and comment syntax inside strings, with optional JSDoc keep. JS Comment Remover is a free online tool from the ToolsRift JavaScript Tools collection. It runs entirely in your browser — nothing to install, no signup, and your data never leaves your device.
Paste your code, optionally enable Preserve JSDoc or Collapse blank lines, then click Remove Comments and copy the result.
No. The scanner tracks string and regex literals, so // inside "http://example.com" or inside a regex is kept — only real comments outside strings are removed.
Yes. Enable 'Preserve JSDoc' to keep /** ... */ documentation blocks while still removing ordinary /* */ and // comments.
After comments are removed, empty leftover lines can remain. Enabling the option collapses those blank lines so the output stays compact.