Skip to main content

Markdown Cheatsheet

By Dejan Panovski Updated on Download PDF

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.

SyntaxDescription
# Heading 1Top-level heading
## Heading 2Second-level heading
### Heading 3Third-level heading
---Horizontal rule
Blank lineSeparate paragraphs
<!-- comment -->HTML comment

Text Formatting

Style words and phrases inline.

SyntaxDescription
**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

Point readers to pages, anchors, files, and media.

SyntaxDescription
[Linuxize](https://linuxize.com)Link to a page
[Heading](#heading)Link to a page anchor
[Reference][id]Reference-style link
[id]: https://linuxize.comReference link target
![Alt text](image.jpg)Image with alt text
[![Alt](image.jpg)](https://example.com)Linked image

Lists

Create ordered, unordered, and task lists.

SyntaxDescription
- ItemUnordered list item
* ItemUnordered list item
1. ItemOrdered list item
- Nested itemNested list item
- [ ] TaskUnchecked task item
- [x] TaskChecked task item

Code Blocks

Show commands, snippets, and configuration files.

SyntaxDescription
`command`Inline code
```Start or end a fenced code block
```bashFenced Bash code block
Four leading spacesIndented 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.

SyntaxDescription
| 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.

SyntaxDescription
> QuoteSingle-line blockquote
> Quote
>
> More
Multi-paragraph blockquote
>> Nested quoteNested blockquote
> - ItemList inside a blockquote
> **Note:** TextStyled note in a quote

Escaping and Special Characters

Print Markdown control characters as literal text.

SyntaxDescription
\*literal asterisk\*Show asterisks
\# not a headingShow a hash at line start
\[text\]Show square brackets
\\Show a backslash
&lt;tag&gt;Show angle brackets
&amp;Show an ampersand

Common Extensions

Use syntax supported by many Markdown renderers.

SyntaxDescription
- [x] DoneTask list item
~~deleted~~Strikethrough
:smile:Emoji shortcode
[^1]Footnote marker
[^1]: Footnote textFootnote definition
term
: definition
Definition list