Remove HTML comments, CSS comments, or JavaScript comments online. Paste code or upload a file, choose the comment types to remove, and copy or download the cleaned result. The free comment remover works in your browser and preserves comment-like text inside CSS and JavaScript strings.
Paste or upload code to preview removed comments.
Remove comments from HTML, CSS, and JavaScript online with this free comment remover. Paste code or upload an HTML, CSS, or JS file, choose which comment types to strip, and see removed comments highlighted in the preview. The cleaned output updates as you work and can be copied or downloaded. All processing happens locally in your browser.
<!-- note --> in an HTML document./* note */ in a stylesheet or an HTML <style> block.// note and /* note */ in a JS file or HTML <script> block.Choose HTML, CSS, or JavaScript from the code-type menu. In HTML mode, the tool can remove HTML comments and comments inside embedded <style> and <script> blocks. CSS and JavaScript modes handle standalone source files. Comment-like text inside quoted CSS and JavaScript strings is preserved. The preview marks comments that will be removed, while the cleaned output appears below it.
.html, .htm, .css, or .js file.In the preview, the comment is highlighted so you can identify exactly what the tool will strip:
<main>
<!-- Temporary campaign banner -->
<p>Welcome to our site.</p>
</main>
The cleaned output removes the highlighted comment and, with the default empty-line option enabled, removes blank lines:
<main>
<p>Welcome to our site.</p>
</main>
The Remove empty lines from the output option is enabled by default. It removes blank and whitespace-only lines after comment removal. Turn it off if you want to keep the original spacing. This setting affects the cleaned output; the preview continues to show the original code with comments highlighted.
Use Copy to copy the cleaned result, or download it as cleaned.html, cleaned.css, or cleaned.js. The download format follows the selected code type. Keep a backup if you may need developer comments later.
Your input is processed in your browser and is not uploaded by this tool. Removing comments can reduce source-file size and strip notes from published code, but it is not a substitute for minification, access control, or a security review.
HTML mode does not open or edit CSS and JavaScript files linked from the document; upload those files separately and select the matching code type. The tool removes comments and optionally blank lines, but it does not minify, format, or validate your code. Review the cleaned output before publishing it.