Markdown is the universal language for writing formatted text. It's used in GitHub READMEs, documentation sites, Notion, Slack, Jupyter notebooks, static site generators, and countless other tools. Once you learn the syntax, you'll use it everywhere.
Headings
Use # symbols for headings level 1—6:
# Heading 1 (largest)
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6 (smallest)
# H1 per document (the title). Start content sections with ## H2. Skip levels sparingly — don't jump from H2 to H4.
Text Formatting
**bold text** ? bold text
*italic text* ? italic text
***bold and italic*** ? bold and italic
~~strikethrough~~ ? strikethrough
`inline code` ? inline code
> blockquote → indented quote block
--- ? horizontal rule
Escaping special characters
Prefix with backslash to show literal characters:
\*not italic\* ? *not italic*
\# not a heading → # not a heading
\[not a link\] ? [not a link]
Links & Images
# Inline link
[Link text](https://example.com)
# Link with title (shows on hover)
[Link text](https://example.com "Hover title")
# Reference-style link (cleaner for repeated URLs)
[Link text][1]
[Another link][1]
[1]: https://example.com "Reference URL"
# Auto-link
<https://example.com>
# Image

# Image with title

# Linked image (clickable)
[](https://example.com)
Lists
Unordered lists
- Item one
- Item two
- Nested item (2 spaces indent)
- Another nested
- Item three
* Also works with asterisks
+ And plus signs
Ordered lists
1. First item
2. Second item
3. Third item
# Auto-numbering (all 1s — Markdown renumbers automatically)
1. First item
1. Second item
1. Third item
Task lists (GFM)
- [x] Completed task
- [ ] Incomplete task
- [ ] Another todo
Code
Inline code
Use `console.log()` to debug.
Use ``code with `backtick` inside`` (double backticks).
Code blocks
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
```
```python
def greet(name):
return f"Hello, {name}!"
```
```bash
npm install markdown-it
```
A language label after the opening fence can request syntax highlighting when the renderer provides it. Common language identifiers: javascript, python, bash, html, css, json, sql, yaml, typescript, java, c, cpp, go, rust.
Tables
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Row 1 | Data | Data |
| Row 2 | Data | Data |
# Alignment
| Left | Center | Right |
|:---------|:--------:|---------:|
| aligned | aligned | aligned |
Use :--- for left align, :---: for center, ---: for right align.
Blockquotes
> Simple blockquote
> Multi-line blockquote
> continues on next line
> Nested blockquote
>> Deeper level
>>> Even deeper
> **Formatted** text inside blockquotes works:
> - Lists too
> - `code` as well
Extended Syntax (Renderer-Dependent)
These extensions vary by renderer. Definition lists are not part of GFM; GitHub alerts and site-supported footnotes are not universal Markdown features. Check the destination renderer.
Footnotes
Here's a statement with a footnote.[^1]
[^1]: This is the footnote content.
Definition lists
Term
: Definition of the term
Another term
: Its definition
Alerts / Admonitions (GitHub)
> [!NOTE]
> Useful information the reader should know.
> [!WARNING]
> Critical content requiring immediate attention.
> [!TIP]
> Optional advice to help the reader succeed.
Collapsed sections
<details>
<summary>Click to expand</summary>
Hidden content goes here.
- Supports Markdown inside
- Including `code` and **formatting**
</details>
Emoji
:rocket: :star: :white_check_mark: :warning:
🚀 ⭐ ✅ ⚠️
Markdown Flavors
| Flavor | Used By | Extra Features |
|---|---|---|
| CommonMark | Standard specification | Core syntax only |
| GFM | GitHub, GitLab | Tables, task lists, strikethrough, autolinks; site-specific extensions vary |
| MDX | Docusaurus, Next.js | JSX components in Markdown |
| MultiMarkdown | Academic writing | Citations, footnotes, math |
| R Markdown | R / data science | Code execution, plots |
Quick Reference
ELEMENT SYNTAX
------------------ --------------------------
Bold **text**
Italic *text*
Code (inline) `code`
Code block ```lang ... ```
Link [text](url)
Image 
Heading # H1 ## H2 ### H3
Unordered list - item
Ordered list 1. item
Task list - [x] done - [ ] todo
Blockquote > text
Table | col | col |
Horizontal rule ---
Footnote text[^1] [^1]: note
Escape \*literal asterisks\*