Complete Markdown Cheatsheet: Syntax, Extensions & Best Practices
What Is Markdown?
Markdown is a lightweight markup language created by John Gruber in 2004. It lets you write formatted content using plain text syntax that's readable even without rendering. Markdown is used everywhere: GitHub READMEs, documentation sites, blogs, note-taking apps, chat platforms, and CMS systems.
Basic Syntax
Headings
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Use headings hierarchically — don't skip levels. Start your document with # H1 and nest subsections with ## H2, ### H3, etc.
Text Formatting
**Bold text** or __bold text__
*Italic text* or _italic text_
***Bold and italic***
~~Strikethrough~~
`Inline code`
Links and Images
[Link text](https://example.com)
[Link with title](https://example.com "Hover title")


Lists
Unordered:
- Item one
- Item two
- Nested item
- Another nested
- Item three
Ordered:
1. First item
2. Second item
3. Third item
Markdown auto-numbers ordered lists — you can use 1. for every item and it will render correctly.
Blockquotes
> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes work too.
Horizontal Rules
---
Extended Syntax (GitHub Flavored Markdown)
Tables
| Column 1 | Column 2 | Column 3 |
|----------|:--------:|---------:|
| Left | Center | Right |
| aligned | aligned | aligned |
The colons in the separator row control text alignment.
Code Blocks with Syntax Highlighting
function greet(name) {
console.log(Hello, ${name}!);
}
Specify the language after the opening fence for syntax highlighting.
Task Lists
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task to do
Footnotes
Here is a statement[^1].
[^1]: This is the footnote content.
Autolinks
URLs and email addresses are automatically linked in GFM:
Visit https://example.com
Contact user@example.com
Frontmatter
Many static site generators and CMS platforms use YAML frontmatter at the top of Markdown files:
---
title: "My Article"
date: "2026-01-15"
tags: ["tutorial", "guide"]
---
Article content starts here.
Best Practices
- Use ATX-style headings (
#) not Setext (===underlines) — they're clearer and support all six levels - Add blank lines before and after headings, lists, and code blocks for consistent rendering
- Use reference-style links for documents with many links to keep the text readable
- Limit line length to 80-120 characters for readable diffs in version control
- Use fenced code blocks with language identifiers for syntax highlighting
- Prefer
-for unordered lists — it's the most widely supported marker - Write meaningful alt text for images — it aids accessibility and displays when images fail to load
CommonMark vs GFM
CommonMark is the standard specification for Markdown syntax. GitHub Flavored Markdown (GFM) extends CommonMark with tables, task lists, strikethrough, and autolinks. Most modern Markdown renderers support GFM.
Converting Markdown
Browser-based tools can convert Markdown to HTML for embedding in websites, or convert HTML back to Markdown for editing. These conversions run entirely in your browser, keeping your content private.