Markdown Cheat Sheet
Complete Markdown syntax reference. From basic formatting to GitHub Flavored Markdown extras. Bookmark this page for quick reference.
| Markdown | Result / Description |
# Heading 1 | Largest heading (<h1>) |
## Heading 2 | Second-level heading (<h2>) |
### Heading 3 | Third-level heading (<h3>) |
#### Heading 4 | Fourth-level heading (<h4>) |
##### Heading 5 | Fifth-level heading (<h5>) |
###### Heading 6 | Smallest heading (<h6>) |
Heading 1 ========= | Alternative h1 syntax (underline with =) |
Heading 2 --------- | Alternative h2 syntax (underline with -) |
Regular paragraph text. | Paragraphs are separated by a blank line |
Line one Line two | Two trailing spaces create a line break (<br>) |
Line one\ Line two | Backslash at end of line also creates a line break |
*italic* or _italic_ | italic |
**bold** or __bold__ | bold |
***bold italic*** | bold italic |
~~strikethrough~~ | strikethrough (GFM) |
> This is a blockquote | Blockquote (indented block) |
> Line 1 > > Line 2 | Multi-paragraph blockquote |
> Outer >> Nested | Nested blockquotes |
| Markdown | Result / Description |
- Item 1 - Item 2 - Item 3 | Unordered list (also * or +) |
1. First 2. Second 3. Third | Ordered list |
1. First 1. Second 1. Third | Ordered list (auto-numbered, all 1.) |
- Item - Nested - Deep nested | Nested list (indent 2-4 spaces) |
1. Ordered - Unordered child | Mixed nested lists |
- [x] Done task - [ ] Open task | Task list / checkbox (GFM) |
- Item 1
Paragraph inside
- Item 2 | List items with paragraphs (indent continuation) |
- Item 1
``` code block ```
- Item 2 | Code block inside a list item (indent 2+ spaces) |
| Markdown | Result / Description |
[Link Text](https://example.com) | Inline link |
[Link](https://example.com "Title") | Inline link with hover title |
[Link][ref]
[ref]: https://example.com | Reference-style link |
[Link][1]
[1]: https://example.com "Title" | Numbered reference link with title |
<https://example.com> | Autolink (URL displayed as clickable link) |
https://example.com | Bare URL autolink (GFM only) |
<user@example.com> | Email autolink |
[Section](#heading-id) | Link to a heading anchor on the same page |
[Top](#) | Link back to top of page |
| Markdown | Result / Description |
 | Inline image |
 | Image with hover title |
![Alt][ref]
[ref]: image.png | Reference-style image |
[](link) | Linked image (image wrapped in a link) |
 | Image without alt text (not recommended for a11y) |
<img src="img.png" width="300"> | HTML image with custom size (Markdown has no size syntax) |
| Markdown | Result / Description |
`inline code` | Inline code with backticks |
``code with `backtick` inside`` | Inline code containing backticks (use double backticks) |
``` code block ``` | Fenced code block (triple backticks) |
~~~ code block ~~~ | Fenced code block (triple tildes) |
```javascript const x = 1; ``` | Fenced block with syntax highlighting (specify language) |
```python print("hello") ``` | Python syntax highlighting |
```diff - removed + added ``` | Diff syntax highlighting |
indented code | Indented code block (4 spaces or 1 tab) |
| Markdown | Result / Description |
| Col 1 | Col 2 | |-------|-------| | Cell | Cell | | Basic table with header row |
| Left | Center | Right | |:-----|:------:|------:| | L | C | R | | Column alignment: left, center, right |
| Name | Value | |------|-------| | `code` | **bold** | | Inline formatting works inside table cells |
| A | B | |---|---| | 1 | 2 | | 3 | 4 | | Minimal table (pipes and hyphens required) |
Col 1 | Col 2 ------|------ A | B | Outer pipes are optional (GFM) |
| Col \| Escaped | |----------------| | Use \| in cells | | Escape pipe character with backslash inside cells |
| Markdown | Result / Description |
--- | Horizontal rule (three hyphens) |
*** | Horizontal rule (three asterisks) |
___ | Horizontal rule (three underscores) |
- - - | Horizontal rule (spaced hyphens also work) |
| Markdown | Result / Description |
<br> | Line break |
<sup>text</sup> | Superscript: text |
<sub>text</sub> | Subscript: text |
<kbd>Ctrl+C</kbd> | Keyboard key: Ctrl+C |
<mark>highlighted</mark> | Highlighted text: highlighted |
<details> <summary>Click me</summary> Hidden content </details> | Collapsible section (HTML5) |
<dl><dt>Term</dt> <dd>Definition</dd></dl> | Definition list (no Markdown equivalent) |
<div align="center"> Centered text </div> | Center-aligned content |
| Markdown | Result / Description |
\*not italic\* | Escaped asterisks appear literally: *not italic* |
\# not a heading | Escaped hash: # not a heading |
\- not a list | Escaped hyphen: - not a list |
\[not a link\] | Escaped brackets: [not a link] |
\`not code\` | Escaped backticks: `not code` |
\\ | Literal backslash: \ |
\| \{ \} \( \) \. \! | Other escapable characters: | { } ( ) . ! |
| Markdown | Result / Description |
- [x] Complete - [ ] Incomplete | Task lists with checkboxes |
~~strikethrough~~ | strikethrough text |
#123 | Auto-linked issue/PR reference (GitHub repos) |
@username | User mention (GitHub notification) |
:emoji_name: | Emoji shortcode (e.g., :rocket: for a rocket) |
Text[^1]
[^1]: Footnote text. | Footnotes (rendered at bottom of page) |
Text[^note]
[^note]: Named footnote. | Named footnotes |
> [!NOTE] > Info message | Alert: informational note (blue) |
> [!TIP] > Helpful advice | Alert: tip (green) |
> [!IMPORTANT] > Key information | Alert: important (purple) |
> [!WARNING] > Potential issue | Alert: warning (yellow) |
> [!CAUTION] > Danger zone | Alert: caution (red) |
```mermaid graph TD; A-->B; ``` | Mermaid diagram (flowchart, sequence, etc.) |
```mermaid sequenceDiagram A->>B: Hello ``` | Mermaid sequence diagram |
```geojson { "type": "Point" } ``` | GeoJSON map rendering (GitHub) |
```math E = mc^2 ``` | Math expressions with LaTeX syntax (GitHub) |
$E = mc^2$ | Inline math expression (GitHub) |