— to hide text from the rendered output.
Syntax
Text inside is completely hidden in the final output. It's still visible in the source markdown file.
Multi-Line Comments
Everything between is hidden, regardless of how many lines it spans.
Use Cases
Comments are useful for:
- Notes to yourself — "TODO: add example here"
- Disabling content — temporarily hide a section without deleting it
- Collaboration notes — leave instructions for other editors
- Draft sections — keep unfinished content in the file without publishing it
Platform Support
HTML comments work on GitHub, GitLab, Obsidian, and most markdown renderers that allow HTML. They also work in PDF exports from MarkdownTools.
Discord and Slack do not render HTML — comments will appear as literal text including the HTML comment is the universally accepted workaround. Some editors (like Obsidian) accept %% as a comment delimiter in their own extended syntax.
Full reference: Markdown Comments.