Cheatsheet

Markdown Cheat Sheet – Syntax Reference & Examples

Complete Markdown syntax reference with examples for headings, lists, tables, code blocks, links, images, and GitHub Flavored Markdown.

Headings

# Heading 1<h1> — page title
## Heading 2<h2> — section title
### Heading 3<h3>
#### Heading 4<h4>
##### Heading 5<h5>
###### Heading 6<h6>

Emphasis

**bold text**Bold — also __bold__
*italic text*Italic — also _italic_
~~strikethrough~~Strikethrough (GFM)
**_bold italic_**Bold and italic combined

Lists

- itemUnordered list (also * or +)
1. itemOrdered list
- nested itemNested list (indent with 2 spaces)
- [ ] unchecked taskTask list — unchecked (GFM)
- [x] checked taskTask list — checked (GFM)

Links & Images

[link text](https://example.com)Inline link
[link text](url "title")Link with hover title
[ref link][1]Reference-style link
[1]: https://example.comReference definition (at bottom)
![alt text](image.png)Inline image
[![alt](img.png)](url)Clickable image link

Code

`inline code`Inline code span
```javascriptFenced code block with language
indented code4-space indented code block

Tables

| Col 1 | Col 2 |Table header row
|-------|-------|Separator row (required)
| val 1 | val 2 |Data row
| :--- | ---: | :---: |Left / right / center alignment

Blockquotes & Rules

> quoted textBlockquote
>> nested quoteNested blockquote
---Horizontal rule (also *** or ___)
\*escaped\*Escape special characters with backslash

GitHub Flavored Markdown (GFM)

- [x] task doneCheckbox task list
:smile: :rocket:Emoji shortcodes
@usernameMention a user
#123Reference issue or PR by number
SHA1234Reference a commit by SHA
~~deleted~~Strikethrough text

Markdown vs HTML

Markdown is a lightweight syntax that converts to HTML. You can mix raw HTML inside Markdown when you need features not supported by the syntax — but most renderers sanitize it, especially on GitHub.

Where Markdown Works

  • GitHub / GitLab — README.md, issues, PRs, wikis
  • Static site generators — Astro, Hugo, Jekyll, Docusaurus
  • Note apps — Obsidian, Notion, Bear, Typora
  • Documentation — MkDocs, Docusaurus, VitePress
  • Chat tools — Slack, Discord (partial), Teams

Markdown Flavors

CommonMark is the standardized spec. GitHub Flavored Markdown (GFM) extends it with tables, task lists, and auto-links. Always check which flavor your renderer supports.