HomeMarkdown → Comments

How to add comments in Markdown

Markdown has no native comment syntax. The standard workaround is an HTML comment<!-- … --> — which most Markdown renderers leave out of the final output.

HTML comments

Anything between the markers is ignored when rendered, and works for single or multiple lines:

<!-- This is a comment. It won't appear in the rendered output. -->

Visible text here.

<!--
Comments can
span multiple lines.
-->
<!-- This is a comment. It won't appear in the rendered output. -->

Visible text here.

<!-- Comments can span multiple lines. -->

Important gotchas

Related: cheat sheet · code blocks.

Have a document instead of text?

Convert PDFs, Word, PowerPoint, Excel, and images into clean Markdown — free, no signup.

Convert a file to Markdown →