Markdown Cheatsheet: Every Syntax You Need (With Examples)

A complete quick reference for Markdown: headings, emphasis, lists, links, images, code blocks, quotes, tables, task lists, and how to escape special characters.

Markdown is a lightweight way to write formatted text using plain characters. It's used for README files, documentation, notes, forum posts, and blogs. The basics take minutes to learn, and this cheatsheet covers the syntax you'll use most.

Headings and text

# Heading 1
## Heading 2
### Heading 3

**bold**   *italic*   ***both***   ~~strikethrough~~

A line with two trailing spaces  
forces a line break. A blank line starts a new paragraph.

Lists

- Bullet item
- Another item
  - Nested item (indent two spaces)

1. First
2. Second
3. Third

- [x] Task done
- [ ] Task to do
[Link text](https://example.com "optional title")
![Alt text](image.png)
<https://example.com>   automatic link

Code

Inline `code` uses single backticks.

```js
// fenced block with a language for syntax highlighting
console.log("hello");
```

Quotes, rules, and tables

> A block quote

---   a horizontal rule

| Name | Role  |
| ---- | ----- |
| Ada  | Admin |

Escaping special characters

Put a backslash before a character that Markdown would otherwise interpret: \* \_ \# \` \[ \]. This is how you write a literal asterisk or underscore.

Flavors differ

  • Original Markdown is small; GitHub Flavored Markdown (GFM) adds tables, task lists, strikethrough, and autolinks.
  • Some platforms add extras such as footnotes, math, or callouts. Check what yours supports.
  • Raw HTML is allowed in many renderers but may be sanitized for safety.

Frequently asked questions

+How do I make a line break in Markdown?

End the line with two spaces (or a backslash in some flavors), or leave a blank line for a new paragraph.

+How do I write a literal asterisk?

Escape it with a backslash, like \*, so it isn't treated as emphasis.

+What is GitHub Flavored Markdown?

An extension of Markdown that adds tables, task lists, strikethrough, and automatic links.

+How do I add a code block with syntax highlighting?

Use three backticks followed by the language name, then close the block with three backticks.

Markdown Cheatsheet & Previewer

Free, runs in your browser — nothing you enter is uploaded.

Open tool →

More guides