Reference
Markdown cheat sheet
Every Markdown rule you need, with the syntax on the left and what it renders to on the right. Covers CommonMark plus the GitHub Flavored Markdown extensions.
Headings
Six levels. Leave a blank line before a heading so it is not absorbed into the paragraph above.
Top-level heading
# Heading level 1
Heading level 1
Section heading
## Heading level 2
Heading level 2
Subsection heading
### Heading level 3
Heading level 3
Alternate syntax for levels 1 and 2
Heading level 1 =============== Heading level 2 ---------------
Heading level 1
Heading level 2
Emphasis
Asterisks and underscores both work. Asterisks are safer inside words.
Bold
**bold text**
Italic
*italic text*
Bold and italic
***bold and italic***
Strikethrough (GFM)
~~struck through~~
Lists
Indent by two spaces to nest. Ordered lists renumber themselves, so you can write 1. all the way down.
Bulleted list
- First item - Second item - Third item
- First item
- Second item
- Third item
Numbered list
1. First item 1. Second item 1. Third item
- First item
- Second item
- Third item
Nested list
- Parent item
- Child item
- Grandchild item- Parent item
- Child item
- Grandchild item
- Child item
Task list (GFM)
- [x] Finished task - [ ] Open task
- xFinished task
- Open task
Links and images
An image is a link with a leading exclamation mark. The alt text matters for accessibility and SEO.
Inline link
[Markdown to Image](https://markdowntoimage.com)
Link with hover title
[Markdown to Image](https://markdowntoimage.com "Convert Markdown")
Image

Automatic link
<https://markdowntoimage.com>
Code
Name the language after the opening fence to get syntax highlighting.
Inline code
Run `npm install` first.
npm install first.Fenced code block
``` plain code block ```
plain code block
Code block with highlighting
```js const total = items.length; ```
const total = items.length;
Blockquotes
Quotes can hold any other Markdown, including lists and code.
Blockquote
> Everything should be made as > simple as possible.
Everything should be made as simple as possible.
Nested blockquote
> Outer quote > >> Inner quote
Outer quoteInner quote
Tables
Columns do not need to line up in the source. Colons in the divider row set the alignment.
Basic table
| Format | Size | | --- | --- | | PNG | 240 KB | | PDF | 96 KB |
| Format | Size |
|---|---|
| PNG | 240 KB |
| 96 KB |
Column alignment
| Left | Center | Right | | :--- | :----: | ----: | | a | b | c |
| Left | Center | Right |
|---|---|---|
| a | b | c |
Other syntax
Three or more dashes make a rule. End a line with two spaces to force a line break without starting a new paragraph.
Horizontal rule
---
Hard line break
First line ends here.\ Second line starts here.
Second line starts here.
Escape a special character
\*not italic\*
Footnote (GFM)
Text with a note.[^1] [^1]: The note itself.
Support
Troubleshooting
- What is the difference between Markdown and GitHub Flavored Markdown?
- GitHub Flavored Markdown (GFM) is a superset of CommonMark. It adds tables, task lists, strikethrough, footnotes, and automatic URL linking. Everything on this page marked GFM needs a renderer that supports those extensions — most modern ones do.
- Why does my heading not render?
- The most common cause is a missing space after the hash marks. Write # Heading, not #Heading. The second cause is a missing blank line above the heading, which makes some parsers treat it as part of the previous paragraph.
- How do I write a line break without a new paragraph?
- End the line with two spaces, or use a backslash at the end of the line. A single newline is collapsed into a space by most parsers, and a blank line starts a new paragraph instead.
- How do I show a literal asterisk or underscore?
- Put a backslash in front of it. Writing \*text\* renders as *text* instead of turning it into italics. The same works for backticks, hashes, brackets, and other Markdown characters.
- Do Markdown tables need aligned columns?
- No. The pipes do not have to line up in the source — the renderer handles the layout. Aligning them only makes the raw file easier to read. What matters is the divider row under the header.