📋 Cheat Sheets

Markdown Cheat Sheet — Syntax You Keep Forgetting


Click any item to expand the syntax and rendered example.

📝 Text Formatting

Headings basics
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
Use only one # per page. Start sections with ##.
Bold, italic, strikethrough basics
**bold**
*italic*
***bold and italic***
~~strikethrough~~
You can also use underscores: _italic_ and __bold__, but asterisks are more common.
Blockquotes basics
> This is a quote.
>
> It can span multiple lines.

Nested quotes:

Like this.

Horizontal rule basics
Three or more dashes, asterisks, or underscores on their own line.
---
***
___
All three produce the same horizontal line.

🔗 Links & Images

Links links
[Link text](https://example.com)
[Link with title](https://example.com "Hover text")

Reference-style (useful for repeated links)

Click here And here

Auto-link

<https://example.com>

Images links
Same as links but with ! in front.
!​[Alt text](image.png)
!​[Alt text](image.png "Optional title")

Reference-style

!​Screenshot

With a link (clickable image)

[!​Alt](full-size.png)

📋 Lists

Unordered & ordered lists lists
# Unordered
- Item one
- Item two
  - Nested item (2 spaces indent)
  - Another nested

Ordered

  1. First
  2. Second
  3. Third

You can use all 1s (Markdown auto-numbers)

  1. First
  2. Second
  3. Third
Task lists / checkboxes lists
Works on GitHub, GitLab, and most Markdown renderers.
- [x] Write the code
- [x] Write tests
- [ ] Update docs
- [ ] Deploy
On GitHub, these render as interactive checkboxes in issues and PRs.
Definition lists lists
Supported in some renderers (not GitHub).
Term
: Definition of the term

Another term : Its definition

💻 Code

Inline code & code blocks code
# Inline
Use `console.log()` to debug.

Fenced code block with syntax highlighting

function greet(name) {
  return `Hello, ${name}!`;
}

Indented code block (4 spaces)

const x = 42;</pre>

Common language tags: javascript, typescript, python, bash, json, css, html, sql, yaml, diff

Diff syntax highlighting code
Use diff as the language for showing changes.
```diff
- const old = "before";
+ const new = "after";
```
Lines starting with - show in red, + in green.

📊 Tables

Basic table table
| Name    | Role      | Status |
|---------|-----------|--------|
| Alice   | Developer | Active |
| Bob     | Designer  | Away   |
The dashes in the second row are required. Columns don't need to be aligned — it just looks nicer.
Column alignment table
Use colons in the separator row.
| Left   | Center  | Right |
|:-------|:-------:|------:|
| text   | text    | text  |
| more   | more    | more  |
:--- = left, :---: = center, ---: = right.

🧩 Advanced / GitHub-Specific

Collapsible section advanced
Uses HTML <details> — works on GitHub and most renderers.
<details>
<summary>Click to expand</summary>

Hidden content goes here.

You can use Markdown inside.

</details>

Leave a blank line after <summary> for Markdown to render inside.

Footnotes advanced
Supported on GitHub and many static site generators.
Here is a statement[^1] with a footnote.
Alerts / callouts (GitHub) github
GitHub-flavored Markdown supports these alert types.
> [!NOTE]
> Useful information.

[!TIP] Helpful advice.

[!IMPORTANT] Key information.

[!WARNING] Urgent info that needs attention.

[!CAUTION] Negative potential consequences.

These render with colored icons on GitHub.

Emoji github
Use shortcodes on GitHub and many platforms.
:rocket: :white_check_mark: :warning: :x:
:star: :fire: :bug: :memo:
:tada: :construction: :recycle: :zap:
Full list: GitHub emoji cheat sheet
Escaping special characters advanced
Use backslash to show literal Markdown characters.
\*not italic\*
\# not a heading
\[not a link\]
\`not code\`
Characters you can escape: \ ` * _ { } [ ] ( ) # + - . ! |