Remove HTML comments
Strip developer comments from HTML or XML markup before you publish it.
Related tools
Remove HTML comments
Developer notes, TODO reminders and commented-out blocks are useful while you build a page, but they have no business in the version you publish. HTML comments ship to every visitor and are visible to anyone who opens view-source, so a leftover note about a hidden discount, an internal URL or an unfinished feature is public the moment you deploy. Paste your markup here and every <!-- … --> comment is removed in one pass, leaving the rest of the document intact.
Two options cover the common edge cases. "Keep IE conditional comments" preserves <!--[if …]> … <![endif]--> blocks, including the downlevel-revealed pair — these are not notes but markup switches that some HTML email templates still rely on, because older Outlook versions read them. "Remove emptied lines" drops a line that held nothing but a comment, so the cleaned file does not end up riddled with blank lines; lines that were already blank in your input are left alone.
The tool works with plain pattern matching, not a full HTML parser. That makes it fast and predictable, but it also means comments inside <script> and <style> blocks are treated like any other markup and removed. An unclosed <!-- runs to the end of the input, which mirrors what a browser renders in that case. Windows and Unix line endings are both handled.
Everything runs locally in your browser. Your markup is never uploaded, so cleaning a CMS export, a client's e-shop product feed or an unreleased email template is safe. The tally under the output shows how many comments were removed and how many bytes you saved; copy the result or download it when you are done.