Markdown guides

Direct answers to the markdown syntax questions everyone hits — each with copyable examples, rendered output, and the renderer-compatibility gotchas (GitHub, Discord, Slack, and friends).

How to center text in markdown

Markdown has no centering syntax — use <div align="center"> or <p align="center"> where HTML is allowed, like GitHub READMEs. Centering images, headings, and tables.

How to make a checkbox in markdown

Create checkboxes in markdown with - [ ] for unchecked and - [x] for checked. Task list syntax for GitHub, GitLab, Obsidian, and Discord, with nesting and gotchas.

How to write a code block in markdown

Make code blocks with triple-backtick fences and a language tag for syntax highlighting. Inline code, escaping backticks, nesting fences, and diff highlighting.

How to write a comment in markdown

Markdown has no comment syntax, but HTML comments <!-- like this --> stay hidden in rendered output. Where they leak, and truly invisible alternatives.

How to add an image in markdown

Embed images in markdown with ![alt text](url). Local paths vs URLs, image links, sizing with HTML width attributes, and captions - with GitHub-specific tips.

How to indent in markdown

Indentation in markdown is syntax, not styling - 2 spaces nests lists, 4 spaces makes a code block. How to indent paragraphs, continue text under list items, and avoid tab pitfalls.

How to make a link in markdown

Create markdown hyperlinks with [text](url). Titles, reference-style links, linking to headings within a page, bare URLs, and opening in a new tab.

How to make a new line in markdown

Single newlines collapse in markdown. Force a line break with two trailing spaces or a backslash, or leave a blank line for a new paragraph. Renderer differences explained.

How to quote text in markdown

Quote text in markdown by starting lines with >. Multi-line and nested blockquotes, quoting code and lists, and GitHub callouts like [!NOTE] explained.

How to strikethrough text in markdown

Cross out text in markdown by wrapping it in double tildes, like ~~this~~. Where strikethrough works (GitHub, Discord, Slack), single vs double tilde, and HTML fallbacks.

How to underline text in markdown

Markdown has no underline syntax — underscores make italics, not underlines. Use HTML <u> or <ins> tags where allowed, and see what works on GitHub, Discord, and Slack.

Prefer everything on one page? See the complete markdown cheat sheet, or put the syntax to work in the free markdown tools.