The Complete Markdown Cheat Sheet
Every Markdown syntax element in one place — from headings and links to tables and task lists.
Markdown is one of those things you learn once and use everywhere. README files, blog posts, documentation, notes, comments on GitHub — it shows up constantly. This cheat sheet covers every standard syntax element so you can keep it as a quick reference.
Headings
Prefix a line with # symbols. The number of hashes sets the heading level, from 1 (largest) through 6 (smallest). Always put a space between the # and your text.
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6Most documents only need levels 1 through 3. If you find yourself reaching for heading 5 or 6, your document structure might be too deeply nested.
Text Formatting
Markdown gives you bold, italic, strikethrough, and inline code. You can combine them too.
**bold text**
*italic text*
***bold and italic***
~~strikethrough~~
`inline code`Bold uses double asterisks or double underscores. Italic uses single asterisks or underscores. I recommend sticking with asterisks — underscores can cause issues in the middle of words depending on the parser.
Links and Images
Links use square brackets for the text and parentheses for the URL. Images are the same pattern but with an exclamation mark in front.
[Link text](https://example.com)
[Link with title](https://example.com "Title text")

You can also use reference-style links if your document has many URLs and you want to keep the source readable:
[Link text][ref-id]
[ref-id]: https://example.com "Optional title"Lists
Unordered Lists
Start each item with -, *, or +. Indent with two or four spaces to create nested items.
- Item one
- Item two
- Nested item
- Another nested item
- Item threeOrdered Lists
Start with a number followed by a period. The actual numbers don't matter to most renderers — they'll auto-number for you — but starting from 1 keeps the source readable.
1. First item
2. Second item
3. Third item
1. Nested ordered item
2. Another nested itemTask Lists
Task lists (checkboxes) are a GitHub Flavored Markdown feature. They work in GitHub issues, PRs, and most Markdown editors.
- [x] Completed task
- [ ] Open task
- [ ] Another open taskBlockquotes
Prefix lines with > to create a blockquote. You can nest them and mix in other Markdown elements.
> This is a blockquote.
>
> It can span multiple paragraphs.
>
> > And you can nest them like this.Blockquotes work well for callouts, quoting external sources, or highlighting important notes in documentation.
Code Blocks
For multi-line code, use three backticks (fenced code blocks). Add a language identifier right after the opening backticks to get syntax highlighting.
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
```
```python
def greet(name):
return f"Hello, {name}!"
```Common language identifiers: javascript, python, bash,json, html, css, typescript,sql, yaml, markdown.
Tables
Tables use pipes and dashes. The second row (separator) is required and controls column alignment.
| Name | Role | Status |
| ------- | --------- | ------- |
| Alice | Engineer | Active |
| Bob | Designer | Active |
| Charlie | Manager | On leave|For alignment, add colons to the separator row:
| Left | Center | Right |
| :------ | :-------: | ------: |
| text | text | text |Tables can be tedious to write by hand. If you're building anything beyond a few rows, a table generator tool will save you time.
Horizontal Rules
Three or more dashes, asterisks, or underscores on their own line create a horizontal divider. I typically use three dashes.
---
***
___Escaping Characters
If you need to display a character that Markdown normally interprets as formatting, put a backslash before it.
\* This won't be italic \*
\# This won't be a heading
\[This won't be a link\]()Characters you might need to escape: \ ` * _ {} [] () # + - . ! |
GitHub Flavored Markdown Extras
GitHub's Markdown parser (GFM) adds a few features on top of standard Markdown that have become widely supported:
Autolinks
URLs and email addresses are automatically converted to links. No need for square brackets.
https://example.com
user@example.comFootnotes
Add footnotes with a caret and bracket syntax. The footnote content goes at the bottom of the document.
Here is a statement[^1].
[^1]: This is the footnote text.Alerts / Admonitions
GitHub supports special blockquote-based alerts for notes, warnings, and tips:
> [!NOTE]
> This is a note.
> [!WARNING]
> This is a warning.
> [!TIP]
> This is a tip.Syntax Highlighting in Diffs
Use the diff language identifier with + and - prefixes to show added and removed lines:
```diff
- const old = "before";
+ const updated = "after";
```Quick Tips
- Leave a blank line before and after headings, lists, and code blocks. Some parsers need it.
- Use a consistent list marker (
-is popular) throughout your document. - Keep lines under 80-100 characters in source for better diffs and readability.
- Preview your Markdown before publishing. Different renderers handle edge cases differently.
- When in doubt, check the CommonMark spec — it's the closest thing to a standard.