---
title: "The Markdown cheat sheet (printable & copy-pasteable)"
description: "A practical one-page Markdown cheat sheet covering syntax, GitHub Flavored Markdown, and common gotchas. Bookmark it."
date: "2025-10-02"
author: "Markdown Viewer Team"
tags: ["markdown", "cheat sheet", "reference"]
cover: "/og.png"
---

You don't need to memorize Markdown. You need a single page you can glance at while you write. Save this one.

## Headings

```md
# H1
## H2
### H3
#### H4
##### H5
###### H6
```

## Emphasis

```md
**bold**  __also bold__
_italic_  *also italic*
~~strikethrough~~
```

## Lists

```md
- Bullet
- Bullet
  - Nested bullet

1. First
2. Second
   1. Nested
```

## Task lists (GFM)

```md
- [x] Done
- [ ] To do
```

## Links and images

```md
[Markdown Viewer](https://trymarkdownviewer.com)
![Alt text](https://example.com/image.png "Optional title")
```

## Code

````md
Inline `code` example.

```ts
// Fenced code block with syntax highlighting.
const greet = (name: string) => `Hello, ${name}!`;
```
````

## Blockquotes

```md
> A blockquote.
>
> > Nested blockquote.
```

## Tables (GFM)

```md
| Column | Aligned | Right |
| ------ | :-----: | ----: |
| Cell   |  Cell   |  Cell |
```

## Horizontal rule

```md
---
```

## Footnotes (GFM)

```md
Some text with a footnote.[^1]

[^1]: This is the footnote.
```

## Math (KaTeX)

```md
Inline: $a^2 + b^2 = c^2$

Block:

$$
\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}
$$
```

## Diagrams (Mermaid)

````md
```mermaid
flowchart LR
  Idea --> Draft --> Publish
```
````

## Emoji shortcodes

```md
:smile: :rocket: :tada: :100: :heart: :coffee: :fire: :sparkles:
```

Roughly 250 common shortcodes are supported, including thumbs-up (`:+1:`), check (`:check:`), warning (`:warning:`), and the full GitHub set.

## Common gotchas

- A list needs a blank line before it.
- A code fence needs **three** backticks — four-backtick fences only work for nested code samples.
- Line breaks: end a line with **two trailing spaces** or use a blank line.
- Pipes (`|`) inside table cells need to be escaped as `\|`.
- Raw HTML works in most renderers, but be careful — many static site generators sanitize it.

## Editor power features

Inside [Markdown Viewer](/editor), beyond the syntax:

- **Find & replace** with regex — `Ctrl/⌘ + F`
- **Beautify** to normalize lists and whitespace — `Ctrl/⌘ + Shift + F`
- **Focus mode** for distraction-free writing — `Ctrl/⌘ + .`
- **One-click PDF export** — downloads directly, no print dialog
- **Smart paste** — rich HTML on the clipboard converts to Markdown
- **Readability stats** — sentence length, top words, Flesch score

## More guides

- [Markdown table guide](/blog/markdown-table-guide) — alignment, escaping, accessibility
- [Markdown images](/blog/markdown-images-guide) — sizing, hosting, alt text
- [Markdown links](/blog/markdown-links-guide) — internal, external, anchors
- [Markdown code blocks](/blog/markdown-code-blocks) — syntax highlighting in 150+ languages
- [Markdown vs HTML](/blog/markdown-vs-html) — when to use which

## Test it live

Open the [editor](/editor) and try every example above. Want to download this page as a `.md` file? Click **Export → Download .md** in the toolbar. Want a printable PDF? Click **Export → PDF**.
