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.