Markdown Cheatsheet
Quick reference for Markdown syntax covering headings, formatting, links, images, lists, tables, code blocks, blockquotes, and common extensions.
Markdown is a lightweight markup format for writing plain text that converts cleanly to HTML. Use this cheatsheet to copy the syntax you need while writing README files, documentation, comments, and notes.
Document Structure
Create headings and separate sections.
| Syntax | Description |
|---|---|
# Heading 1 | Top-level heading |
## Heading 2 | Second-level heading |
### Heading 3 | Third-level heading |
--- | Horizontal rule |
| Blank line | Separate paragraphs |
<!-- comment --> | HTML comment |
Text Formatting
Style words and phrases inline.
| Syntax | Description |
|---|---|
**bold** | Bold text |
*italic* | Italic text |
***bold italic*** | Bold and italic text |
~~strikethrough~~ | Strikethrough text |
`code` | Inline code |
<sub>sub</sub> | Subscript with HTML |
<sup>sup</sup> | Superscript with HTML |
Links and Images
Point readers to pages, anchors, files, and media.
| Syntax | Description |
|---|---|
[Linuxize](https://linuxize.com) | Link to a page |
[Heading](#heading) | Link to a page anchor |
[Reference][id] | Reference-style link |
[id]: https://linuxize.com | Reference link target |
 | Image with alt text |
[](https://example.com) | Linked image |
Lists
Create ordered, unordered, and task lists.
| Syntax | Description |
|---|---|
- Item | Unordered list item |
* Item | Unordered list item |
1. Item | Ordered list item |
- Nested item | Nested list item |
- [ ] Task | Unchecked task item |
- [x] Task | Checked task item |
Code Blocks
Show commands, snippets, and configuration files.
| Syntax | Description |
|---|---|
`command` | Inline code |
``` | Start or end a fenced code block |
```bash | Fenced Bash code block |
| Four leading spaces | Indented code block |
````<br>```bash<br>echo "hi"<br>```<br>```` | Fence a block that contains triple backticks |
Tables
Use pipes and dashes to build simple tables.
| Syntax | Description |
|---|---|
| Name | Role | | Header row |
|------|------| | Separator row |
| a | b | | Data row |
|:---| | Left-align column |
|---:| | Right-align column |
|:---:| | Center-align column |
Blockquotes
Quote text and nest quoted lines.
| Syntax | Description |
|---|---|
> Quote | Single-line blockquote |
> Quote>> More | Multi-paragraph blockquote |
>> Nested quote | Nested blockquote |
> - Item | List inside a blockquote |
> **Note:** Text | Styled note in a quote |
Escaping and Special Characters
Print Markdown control characters as literal text.
| Syntax | Description |
|---|---|
\*literal asterisk\* | Show asterisks |
\# not a heading | Show a hash at line start |
\[text\] | Show square brackets |
\\ | Show a backslash |
<tag> | Show angle brackets |
& | Show an ampersand |
Common Extensions
Use syntax supported by many Markdown renderers.
| Syntax | Description |
|---|---|
- [x] Done | Task list item |
~~deleted~~ | Strikethrough |
:smile: | Emoji shortcode |
[^1] | Footnote marker |
[^1]: Footnote text | Footnote definition |
term: definition | Definition list |