Markdown Cheatsheet
Markdown Cheatsheet
A quick reference for Markdown and GitHub Flavored Markdown (GFM).
Text Formatting
**bold** or __bold__
*italic* or _italic_
~~strikethrough~~
`inline code`
***bold and italic***
bold or bold
italic or italic
strikethrough
inline code
bold and italic
Headings
# H1
## H2
### H3
#### H4
##### H5
###### H6
Links & Images
[link text](https://example.com)
[link with title](https://example.com "Title")
[relative link](../other-file.md)



Blockquotes
> Single line quote
>
> > Nested quote
>
> **Formatted** text inside a quote
Single line quote
Nested quote
Formatted text inside a quote
Lists
Unordered
- Item
- Item
- Nested item
- Nested item
- Deeply nested
* Also works with asterisks
+ And plus signs
- Item
- Item
- Nested item
- Nested item
- Deeply nested
Ordered
1. First
2. Second
3. Third
1. Nested (indented)
2. Still nested
- First
- Second
- Third
- Nested (indented)
- Still nested
Mixed
1. Step one
- Sub-point
- Another sub-point
2. Step two
> A note about step two
3. Step three
- Step one
- Sub-point
- Another sub-point
- Step two
A note about step two
- Step three
Task Lists (GFM)
- [x] Completed task
- [x] Another completed task
- [ ] Pending task
- [ ] Blocked task
- Completed task
- Another completed task
- Pending task
- Blocked task
Code Blocks
Fenced with Syntax Highlighting
```python
def greet(name: str) -> str:
return f"Hello, {name}!"
print(greet("World"))
```
def greet(name: str) -> str:
return f"Hello, {name}!"
print(greet("World"))
Inline Code
Use `npm install` to install dependencies.
Use npm install to install dependencies.
Common Language Identifiers
| Language | Identifier |
|---|---|
| JavaScript | js or javascript |
| TypeScript | ts or typescript |
| Python | python or py |
| Bash | bash or sh |
| YAML | yaml or yml |
| JSON | json |
| SQL | sql |
| CSS | css |
| HTML | html |
| Dockerfile | dockerfile |
Tables (GFM)
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
| Left-aligned | Center-aligned | Right-aligned |
|:-------------|:--------------:|--------------:|
| Left | Center | Right |
| L | C | R |
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
| Left-aligned | Center-aligned | Right-aligned |
|---|---|---|
| Left | Center | Right |
| L | C | R |
Horizontal Rule
---
***
___
Footnotes (GFM)
Here is a statement that needs a citation[^1] and another one[^2].
[^1]: This is the first footnote.
[^2]: This is the second footnote with **formatting**.
Here is a statement that needs a citation1 and another one2.
Definition Lists (GFM)
Term 1
: Definition of term 1
Term 2
: Definition of term 2
: Another definition for term 2
Term 1 : Definition of term 1
Term 2 : Definition of term 2 : Another definition for term 2
Escaping
\*not italic\*
\# not a heading
\[not a link\]
\`not code\`
*not italic*
Keyboard Keys (GFM)
Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.
Press <kbd>Alt</kbd> + <kbd>F4</kbd> to close.
Press Ctrl + C to copy. Press Alt + F4 to close.
Alerts / Admonitions (GFM)
> [!NOTE]
> Useful information.
> [!TIP]
> Helpful suggestion.
> [!IMPORTANT]
> Key information.
> [!WARNING]
> Cautionary advice.
> [!CAUTION]
> Potential danger.
[!NOTE] Useful information.
[!TIP] Helpful suggestion.
[!IMPORTANT] Key information.
[!WARNING] Cautionary advice.
[!CAUTION] Potential danger.
URLs & Autolinks
<https://example.com>
<user@example.com>
https://example.com user@example.com
Emojis (GFM)
:thumbsup: :rocket: :warning: :check_mark:
:thumbsup: :rocket: :warning: :check_mark:
Math (where supported)
Inline: $E = mc^2$
Block:
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$
Inline: $E = mc^2$
Block: $$ \sum_{i=1}^{n} i = \frac{n(n+1)}{2} $$
Mermaid Diagrams (where supported)
```mermaid
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
C --> D
```
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
C --> D
HTML in Markdown
Most Markdown processors allow inline HTML:
<details>
<summary>Click to expand</summary>
Hidden content here.
</details>
<sup>superscript</sup> and <sub>subscript</sub>
<br>
<div align="center">
Centered content
</div>
Click to expand
Hidden content here.
superscript and subscript