Markdown is the most widely used markup language for writing documentation, README files, blog posts, and technical content. Whether you're writing a GitHub README, a blog post, or documentation for your project, this cheat sheet has you covered.
Bookmark this page for quick reference — it covers everything from basic syntax to advanced formatting.
⚡ Try Markdown Live
Type Markdown on the left, see HTML output instantly on the right.
Open Markdown to HTML Converter →📌 Headers
| Markdown | HTML Output |
|---|---|
# Heading 1 | <h1>Heading 1</h1> |
## Heading 2 | <h2>Heading 2</h2> |
### Heading 3 | <h3>Heading 3</h3> |
#### Heading 4 | <h4>Heading 4</h4> |
##### Heading 5 | <h5>Heading 5</h5> |
###### Heading 6 | <h6>Heading 6</h6> |
📝 Text Formatting
| Markdown | Result |
|---|---|
**bold text** | bold text |
*italic text* | italic text |
***bold italic*** | bold italic |
~~strikethrough~~ | |
`inline code` | inline code |
📋 Lists
Unordered List
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Item 3
Ordered List
1. First item
2. Second item
3. Third item
1. Nested item 3.1
2. Nested item 3.2
Task List (GitHub Flavored)
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task
🔗 Links & Images
| Markdown | HTML Output |
|---|---|
[link text](https://example.com) | <a href="...">link text</a> |
[link](https://example.com "title") | Link with title attribute |
 | <img src="..." alt="..."> |
[](link) | Image as link |
💻 Code Blocks
Inline Code
Use `console.log()` to print output.
Fenced Code Block
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet('World'));
```
Indented Code Block
// Indent with 4 spaces
const x = 42;
📊 Tables
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
| Left | Center | Right |
|:-----|:------:|------:|
| L | C | R |
📌 Blockquotes
> This is a blockquote
>
> It can span multiple lines
Nested Blockquotes
> Outer quote
>
>> Nested quote
➖ Horizontal Rules
---
***
___
🎯 Extended Syntax (GitHub Flavored Markdown)
Footnotes
Here's a sentence with a footnote[^1].
[^1]: This is the footnote content.
Strikethrough
~~This was mistaken text~~
Emoji (GitHub)
:smile: :heart: :thumbsup:
:rocket: :trophy: :100:
Alerts (GitHub)
> [!NOTE]
> Useful information users should know.
> [!TIP]
> Helpful advice for doing things better.
> [!WARNING]
> Urgent info that needs attention.
> [!CAUTION]
> Advises about risks.
📱 Platform-Specific Features
| Platform | Special Features |
|---|---|
| GitHub | Task lists, alerts, mentions (@user), issues (#123), emoji |
| GitLab | Mermaid diagrams, math (KaTeX), video |
| Notion | Callouts, toggles, databases, embeds |
| Slack | No headers, simple formatting only |
| Discord | No headers, spoilers (||text||) |
✅ Best Practices
- Use ATX headers (
#) instead of Setext (underlines) - Add blank lines before and after block elements
- Use fenced code blocks with language identifiers
- Keep lines under 80 characters for raw readability
- Use reference-style links for long URLs
- Always include alt text for accessibility
🔗 Conclusion
Markdown is simple yet powerful. With these syntax patterns, you can create well-structured, readable content for any platform. The beauty of Markdown is that it's readable both as raw text and as rendered HTML.
Start with the basics — headers, lists, and links — then explore extended features as you need them.