Markdown cheatsheet
The syntax on the left, what it becomes on the right. Copy any snippet. Everything here is CommonMark plus the GitHub extensions most tools support.
Headings
# Heading 1Heading 1
## Heading 2Heading 2
### Heading 3Heading 3
Heading 1
=========Setext style, H1 onlyHeading 1
Heading 2
---------Setext style, H2 onlyHeading 2
Emphasis
*italic* or _italic_italic or italic
**bold** or __bold__bold or bold
***bold italic***bold italic
~~strikethrough~~GFMstrikethrough
Inline `code` spanInline code span
Escape \*literal asterisks\*Escape *literal asterisks*
Lists
- Item
- Item
- Nested itemAlso * or +- Item
- Item
- Nested item
1. First
2. Second
3. Third- First
- Second
- Third
1. First
1. Second
1. ThirdNumbers are normalised- First
- Second
- Third
- [x] Done
- [ ] To doTask list, GFM- Done
- To do
Links and images
[Link text](https://russ.md)[Link with title](https://russ.md "Markdown tools")<https://russ.md>Autolink[Reference link][ref]
[ref]: https://russ.md[Section link](#headings)Anchor to a headingCode
```js
const x = 1;
```Fenced block with a languageconst x = 1;
indented four spacesIndented blockindented four spaces
``code with a ` backtick``code with a ` backtick
Tables
| Left | Centre | Right |
|:-----|:------:|------:|
| a | b | c |Colons set alignment| Left | Centre | Right |
|---|---|---|
| a | b | c |
Name | Qty
--- | ---
Pi | 1Outer pipes are optional| Name | Qty |
|---|---|
| Pi | 1 |
Quotes, rules and breaks
> A quotation
>
> > NestedA quotation
Nested
---Horizontal rule; also *** or ___Line one
Line twoTwo trailing spaces break the lineLine one
Line two
Line one\
Line twoA backslash also worksLine one
Line two
Extras
<details>
<summary>Click</summary>
Hidden content
</details>Inline HTML where it is allowedClick
Hidden content
<!-- a comment -->Not rendered---
title: Front matter
---YAML front matter, used by most static site tools---
title: Front matter
---