Markdown Cheat Sheet
Plain-text formatting used in READMEs, GitHub, Notion, Obsidian, Discord and docs sites. Extra features marked GFM work on GitHub (GitHub Flavored Markdown).
On this page
Text #
| You write | You get |
|---|---|
**bold** | bold |
*italic* or _italic_ | italic |
***bold italic*** | bold italic |
~~strike~~ (GFM) | |
`code` | code |
<kbd>Ctrl</kbd> | Ctrl |
H<sub>2</sub>O, x<sup>2</sup> | H2O, x2 |
\*not italic\* | *not italic* (backslash escapes) |
Headings #
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
Lists #
- Bullet
- Another
- Nested (indent 2 spaces)
1. First
2. Second
1. Nested
- [ ] To do (GFM task list)
- [x] Done
Links & Images #
[Link text](https://example.com)
[Link with title](https://example.com "Hover title")
<https://example.com> auto-link
[Jump to a section](#lists) heading anchors: lowercase, spaces → -

[](https://example.com)
[Reference link][docs]
[docs]: https://docs.example.com
Code #
Inline: `npm install`
```js
console.log("fenced block with syntax highlighting");
```
```diff
- removed line
+ added line
```
Tables (GFM) #
| Left | Center | Right |
|:-------|:------:|------:|
| a | b | c |
Write \| to put a pipe inside a cell.
Blocks #
> Blockquote
> > Nested quote
--- horizontal line
> [!NOTE] GitHub alert boxes:
> Useful info. NOTE, TIP, IMPORTANT, WARNING, CAUTION
<details>
<summary>Click to expand</summary>
Hidden content (leave a blank line after the summary).
</details>
Extras #
| Feature | Syntax |
|---|---|
| Footnote (GFM) | Text[^1] … [^1]: The note. |
| Line break | End the line with two spaces or <br> |
| Emoji (GitHub) | :rocket: |
| Math (GitHub) | $E = mc^2$ or a $$ … $$ block |
| Diagram (GitHub) | A fenced block with the language mermaid |
| Front matter | YAML between --- lines at the very top (Astro, Jekyll, Obsidian) |
Mermaid Example #
flowchart LR
A[Write] --> B[Commit] --> C[Push]
Tips #
- Leave a blank line before and after lists, headings, tables and code blocks.
- VS Code:
Ctrl + Shift + Vopens a preview,Ctrl + K Vopens it side by side.
Nothing on this sheet matches “”.