Markdown Comments Tool

Markdown Comments Tool

Learn how to add comments in Markdown. Create hidden comments for GitHub, documentation, and other platforms using HTML and reference-style methods.

Markdown Comment Generator - Add Comments in Markdown

Create hidden comments in markdown for GitHub, documentation, and other platforms. Use this free tool to generate properly formatted markdown comments with different syntax methods.

Comment Settings

Markdown Comment Output

How to Add Comments in Markdown - Syntax Guide

Comments in markdown allow you to include notes, reminders, or explanations in your document without them appearing in the rendered output. This is useful for documentation, collaboration, and organizing your content.

HTML Comments in Markdown (Most Compatible)

The most widely supported method for adding comments in markdown is using HTML comment syntax. This works in GitHub, GitLab, and most markdown processors:

markdown
<!-- This is a comment that won't appear in the rendered markdown -->

<!-- 
  Multi-line comments
  are also supported
  like this
-->

This text will be visible in the rendered output.

HTML comments are the most reliable way to add comments in markdown and work across virtually all platforms, including GitHub comments, documentation sites, and markdown editors.

Reference-Style Comments in Markdown

This less-known method uses reference-style link syntax that doesn't get displayed:

markdown
[//]: # (This is a comment in markdown using reference syntax)

This text will be visible.

[//]: # "Double quotes also work for comments"
[//]: # 'As do single quotes'

This method works well in GitHub markdown and many other platforms. It's less obvious than HTML comments in the source, but still effective for hiding notes in your documents.

Empty Link Comments in Markdown

Another variation uses an empty link reference:

markdown
[comment]: <> (This is another way to write comments in markdown)

Visible content appears here.

[//]: <> (Alternative version)
[_]: <> (Underscore version)

This method has moderate compatibility across markdown platforms but isn't as widely supported as HTML comments.

Extension-Specific Comments

Some markdown applications support their own special comment syntax:

markdown
%% This is an Obsidian-style comment %%

%%
Multi-line Obsidian
comments work like this
%%

The double percent syntax is specific to Obsidian and won't work in most other markdown processors, including GitHub. Use this only if you're working exclusively in Obsidian.

Practical Comment Examples in Markdown

1. Document organization with markdown comments

markdown
# Project Documentation

<!-- 
  TODO: 
  - Add installation instructions
  - Include screenshots
  - Link to API docs
-->

## Introduction

This project provides a simple interface for...

2. Collaborative editing using comments in markdown

markdown
# Team Report

<!-- @Sarah: Please verify these numbers before publishing -->

## Financial Summary

Revenue increased by 15% compared to Q2...

<!-- @Jason: We need more details in this section -->

3. Temporarily hiding content with markdown comments

markdown
# Current Team Members

- Jane Smith, Developer
- John Doe, Designer

<!-- 
# Former Team Members
- Alex Johnson (2018-2021)
- Maria Garcia (2019-2022)
-->

## Contact Information

Need more details on Markdown syntax? Our comprehensive cheat sheet covers all elements in detail:

Explore Complete Markdown Syntax

Frequently Asked Questions About Markdown Comments

What are comments in markdown?

Comments in markdown are sections of text that are included in the source document but don't appear in the rendered output. They're useful for leaving notes, explanations, or reminders for yourself or other contributors without affecting the final displayed content. Markdown itself doesn't have a native comment syntax, but several methods (like HTML comments) are widely used.

How do I add comments in GitHub markdown?

To add comments in GitHub markdown, the most reliable method is to use HTML comment syntax: <!-- Your comment here -->. This works in GitHub issues, pull requests, README files, and other markdown documents. GitHub also supports reference-style comments like [//]: # (Your comment here), which are less visible in the source.

Can I create multi-line comments in markdown?

Yes, you can create multi-line comments in markdown using HTML comment syntax. Simply place your comment between the opening and closing tags, like this:

markdown
<!-- 
  This is a multi-line comment
  that spans several lines
  in the markdown document
-->

This works well in most markdown processors, including GitHub, GitLab, and standard markdown editors.

Are markdown comments visible in the source code?

Yes, all markdown comments remain visible in the source code or when editing the raw markdown file. They're only hidden when the markdown is rendered to HTML for display. This means anyone who can access your raw markdown file will be able to see the comments. If you need to hide sensitive information, don't put it in comments.

Which comment method has the best compatibility?

HTML comments (<!-- comment -->) have the best compatibility across different markdown processors and platforms. They work in GitHub, GitLab, Reddit, Stack Overflow, most markdown editors, and static site generators. If you want your comments to work everywhere, HTML comments are the safest choice. Reference-style comments have good but not universal support, while extension-specific comments like Obsidian's %% comment %% only work in their specific applications.

Can I use markdown comments inside code blocks?

No, markdown syntax (including comment syntax) is not processed inside code blocks. If you place an HTML comment or any other markdown comment syntax inside a code block (wrapped in backticks or indented), it will be displayed literally as text rather than being treated as a comment. Code blocks are meant to display code or text exactly as written. If you need to comment code within a code block, use the comment syntax of the language being displayed (e.g., // for JavaScript, # for Python).

Other Useful Tools

Markdown Preview Tool

Convert your Markdown text to beautiful HTML in real-time. Supports code highlighting, tables, and more.

Markdown Cheat Sheet

Complete reference guide to Markdown syntax with examples for formatting, tables, code blocks, and more.

Markdown Table Generator

Create markdown tables easily with our visual editor. Generate tables for GitHub markdown, documentation, and more. Customize alignments, import/export data, with live preview.

Markdown Hyperlink Generator

Easily create Markdown hyperlinks. Generate syntax for standard, automatic, and reference links, perfect for websites, docs, and platforms like Discord.

Markdown Strikethrough Generator

Create strikethrough text in markdown for GitHub, Discord, and other platforms. Learn different strikethrough markdown methods and format your text with double tildes.

Markdown New Line Generator

Learn how to add new lines in markdown documents. Try different line break methods for GitHub, Discord, and other platforms using trailing spaces, backslash, and HTML br tags.

HTML Table to Markdown Converter

Convert HTML tables to Markdown format instantly. Paste HTML code and get properly formatted Markdown tables.

Markdown Word Counter

Count words, characters, and estimate reading time for your Markdown text. Intelligently ignores code blocks.

Markdown to Text

Clean up Markdown syntax from AI outputs. Convert formatted Markdown to simple TXT content while preserving structure.

Markdown to LaTeX Converter

Extract and convert mathematical formulas from Markdown to LaTeX format for academic papers and scientific documents.