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 -->.
<!-- This is a private editor comment. It will not render in the final HTML. --> Visible paragraph of your document.
Visible paragraph of your document. (The HTML comment is invisible in output)
Platform Compatibility & Differences
Supported in READMEs, PRs, and issues. The comment is completely hidden in rendered view.
Discord does NOT support HTML comments; typing `<!-- -->` will display literally in chat.
Does not support raw HTML comments; text displays literally.
Supported in Markdown cells and hidden when the cell is rendered.
How to Use Markdown Comment
- Copy the ready-to-use HTML Comments syntax snippet below.
- Inspect the rendered live preview in both light and dark themes.
- Review platform compatibility differences for GitHub, Discord, Reddit, and Jupyter notebooks.
- 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.
<!-- This is a private editor comment. It will not render in the final HTML. --> Visible paragraph of your document.
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.