Markdown cheat sheet
This page lists the Markdown you will use most, in one place. Each element shows the source first, then how it renders. Everything here is CommonMark unless it is marked as GitHub Flavored Markdown (GFM).
Headings
Start a line with one to six # characters, then a space. One # is the top level.
# Heading 1
## Heading 2
### Heading 3
Result: headings are not rendered here, because they would mix into this page’s own outline. # Heading 1 becomes the largest heading, ### Heading 3 a smaller one. The space after the # is required in CommonMark: #Heading is a plain paragraph.
Emphasis
Use one asterisk or underscore for italic, two for bold, three for both.
*italic* or _italic_, **bold** or __bold__, ***bold italic***
Result:
italic or italic, bold or bold, bold italic
Strikethrough (GFM)
~~No longer true~~
Result:
No longer true
Paragraphs and line breaks
A blank line starts a new paragraph. A single line break inside a paragraph is treated as a space. To force a line break, end the line with a backslash or two spaces.
First line\
Second line, same paragraph.
A new paragraph.
Result:
First line
Second line, same paragraph.
A new paragraph.
Blockquotes
> Quoted text.
>
> > A nested quote.
Result:
Quoted text.
A nested quote.
Lists
Use -, * or + for bullets and a number with . or ) for ordered lists. Indent nested items to line up with the parent’s text. See Markdown lists for the full rules.
- Apples
- Pears
- Williams
1. First
2. Second
Result:
- Apples
- Pears
- Williams
- First
- Second
Task lists (GFM)
- [x] Write the draft
- [ ] Review it
Result:
- Write the draft
- Review it
Links
[CommonMark](https://commonmark.org "The spec") and <https://github.github.com/gfm/>
Result:
CommonMark and https://github.github.com/gfm/
In GFM, a bare www. or https:// address also becomes a link without the angle brackets.
Images
An image is a link with ! in front. The text in brackets is the alt text.

Result:
Code
Wrap inline code in backticks. For a block, put three backticks on the lines before and after, with an optional language name.
Run `ls -la` in the terminal.
```js
console.log("hello");
```
Result:
Run ls -la in the terminal.
console.log("hello");
Tables (GFM)
| Name | Price |
|-------|------:|
| Basic | 0 |
| Pro | 12.99 |
Result:
| Name | Price |
|---|---|
| Basic | 0 |
| Pro | 12.99 |
Horizontal rule
Three or more -, * or _ on their own line. Leave a blank line above ---, or the line above becomes a heading.
Text above.
---
Result:
Text above.
Escaping characters
A backslash turns a Markdown character into plain text.
\*not italic\* and \# not a heading
Result:
*not italic* and # not a heading
Footnotes
Footnotes are not part of CommonMark or the GFM spec, but GitHub and many other apps support them.
Markdown was created in 2004.[^1]
[^1]: By John Gruber, with Aaron Swartz.
Result: not rendered here, because a footnote adds its own section to the end of the page. The sentence gets a small superscript number that links to the note, and the note links back to the sentence.
Where it works
Headings, emphasis, paragraphs, blockquotes, lists, links, images, code and escapes are CommonMark. Every app that follows CommonMark renders them the same way.
Tables, task lists, strikethrough and bare-URL autolinks come from GFM. GitHub and GitLab render all of them. Obsidian renders tables, task lists and strikethrough. The built-in Markdown preview in VS Code renders tables and strikethrough; for task lists and footnotes there, check your version and extensions. Footnotes work on GitHub, GitLab and in Obsidian. For any other app, check your app.
If you want to read .md files like these without the raw syntax, Markko shows them formatted on a Mac and in Quick Look.
FAQ
What is the difference between CommonMark and GitHub Flavored Markdown?
CommonMark is a precise specification of core Markdown. GitHub Flavored Markdown (GFM) is a superset of CommonMark that adds tables, task lists, strikethrough, extended autolinks and a filter for some raw HTML tags.
Should I use * or _ for emphasis?
Both work. The asterisk is the safer choice inside words: un*frigging*believable gets emphasis, but un_frigging_believable does not.
How do I show a literal asterisk or other Markdown character?
Put a backslash in front of it, for example \* or \#. Any ASCII punctuation character can be escaped this way.