Markdown Comment: How to Add Hidden Notes in Markdown

Standard Markdown does not have native comment syntax, but because Markdown parses inline HTML, you can write hidden comments using HTML comments: <!-- This comment will not be displayed -->.

Syntax Code Snippet
<!-- This is a private editor comment. It will not render in the final HTML. -->

Visible paragraph of your document.
Rendered HTML Output Preview

Visible paragraph of your document. (The HTML comment is invisible in output)

Platform Compatibility & Differences

GitHub (GFM):

Supported in READMEs, PRs, and issues. The comment is completely hidden in rendered view.

Discord Chat:

Discord does NOT support HTML comments; typing `<!-- -->` will display literally in chat.

Reddit:

Does not support raw HTML comments; text displays literally.

Jupyter Notebooks:

Supported in Markdown cells and hidden when the cell is rendered.

How to Use Markdown Comment

  1. Copy the ready-to-use HTML Comments syntax snippet below.
  2. Inspect the rendered live preview in both light and dark themes.
  3. Review platform compatibility differences for GitHub, Discord, Reddit, and Jupyter notebooks.
  4. Check common pitfalls and copy formatted snippets directly.

Practical Examples

HTML Comments Syntax Pattern

HTML comments allow you to leave notes, editorial instructions, or bookmarks in Markdown files without displaying them to readers.

Input:
<!-- This is a private editor comment. It will not render in the final HTML. -->

Visible paragraph of your document.
Output:
Rendered visual format

Common Mistakes & Troubleshooting

  • Using programming language comments like `//` or `/* */`, which render as plain text.
  • Expecting comments to hide text on platforms like Discord or Slack that do not process HTML.

Frequently Asked Questions

Are Markdown comments visible in the rendered output?

No. HTML comments are omitted from visible browser rendering, though they remain in the source file and page source inspection.