Markdown Toolbox Logo Markdown Toolbox
Home
Blog

How do I add comments in markdown?

2024-09-02

Short version

Markdown doesn’t support comments natively. Use HTML comments instead.

<!-- This is a comment -->

Long version

Introduction

While Markdown is perfect for creating formatted text, it does not have a built-in comment feature. However, you can still add comments by utilizing HTML comment elements.


Adding Comments in Markdown

To add comments in your Markdown file, simply use the HTML comment syntax. Anything written inside <!-- and --> will be ignored during rendering:

<!-- This comment will not appear in the output -->

You can add comments anywhere in your document without affecting the output content.

Conclusion

For adding comments in Markdown, using HTML comments remains the best approach. This way, you can include notes and explanations in your raw Markdown that won't appear in the final document.