Learn how to add comments in markdown that won't render in the output. Syntax for HTML comments, platform support, and use cases.
Markdown doesn't have its own comment syntax. To add hidden comments that won't appear in the rendered output, use HTML comments (<!-- -->). These are useful for notes to collaborators, TODOs, and temporary content.
HTML comments are hidden in the rendered output. Most markdown parsers pass them through.
Comments can span multiple lines. Everything between <!-- and --> is hidden.
| Platform | Supported | Notes |
|---|---|---|
| GitHub | Yes | Hidden in rendered markdown |
| GitLab | Yes | — |
| Discord | No | Shows raw text — no comment support |
| Slack | No | Shows raw text |
| No | No comment support | |
| Stack Overflow | Yes | — |
| Notion | No | Use /comment for Notion-native comments |
| Obsidian | Yes | Also supports %%comment%% syntax |
// This is a comment
<!-- This is a comment -->
Markdown doesn't support // or # comments like programming languages. Use HTML comment syntax.
<!- Comment ->
<!-- Comment -->
HTML comments require exactly <!-- to open and --> to close. Missing dashes will break the syntax.
Comments are perfect for leaving notes: <!-- TODO: update stats --> won't show in the rendered document.
Wrap sections in <!-- --> to hide them without deleting. Useful for drafts and content you might restore later.
HTML comments are hidden in rendered output but visible in page source. Don't put sensitive info in comments.
Everything you need to know.
Use HTML comment syntax: <!-- your comment here -->. The comment won't appear in the rendered output.
Markdown headings are created with hash symbols (#). One hash for H1 (largest), two for H2, up to six for H6 (smallest). Headings structure your document and create a hierarchy that readers and search engines can follow.
A horizontal rule creates a visual divider across the page. In markdown, use three or more hyphens (---), asterisks (***), or underscores (___) on their own line. Horizontal rules separate sections and improve document readability.
Markdown supports two types of code formatting: inline code with single backticks (`) for short snippets, and fenced code blocks with triple backticks (```) for multi-line code with optional syntax highlighting.
Paste your markdown and see comment rendered instantly with professional themes.