📝 Markdown Syntax Cheatsheet
Complete reference guide for Markdown formatting - From basics to advanced techniques
🎯 Quick Reference
Headers
# H1 through ##### H6
Bold
**text** or __text__
Italic
*text* or _text_
Links
[text](url)
Images

Code
`inline` or ```block```
📋 Headers
Markdown
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Result
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
💡 Pro Tip:
Always include a space after the # symbol. Alternative syntax using underlines (=== or ---) also works for H1 and H2.
✨ Text Formatting
Bold Text
Markdown
**Bold text**
__Also bold__
Result
Bold text
Also bold
Also bold
Italic Text
Markdown
*Italic text*
_Also italic_
Result
Italic text
Also italic
Also italic
Bold & Italic
Markdown
***Bold and italic***
___Also bold and italic___
**_Mix and match_**
Result
Bold and italic
Also bold and italic
Mix and match
Also bold and italic
Mix and match
Strikethrough
Markdown
~~Strikethrough text~~
Result
📝 Lists
Unordered Lists
Markdown
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Item 3
* Also works with asterisks
+ Or plus signs
Result
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Item 3
Ordered Lists
Markdown
1. First item
2. Second item
1. Nested item
2. Nested item
3. Third item
Result
- First item
- Second item
- Nested item
- Nested item
- Third item
Task Lists
Markdown
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task
Result
- ☑ Completed task
- ☐ Incomplete task
- ☐ Another task
🔗 Links & Images
Links
Markdown
[Link text](https://example.com)
[Link with title](https://example.com "Hover text")
[Reference link][1]
[1]: https://example.com
Images
Markdown


[](https://example.com)
Result
[Image: Alt text]
💻 Code
Inline Code
Markdown
Use `code` in your sentence.
Use `` `backtick` `` to show backtick.
Result
Use
Use
code in your sentence.Use
`backtick` to show backtick.
Code Blocks
Markdown
```javascript
function hello() {
console.log("Hello World");
}
```
```python
def hello():
print("Hello World")
```
Result
function hello() {
console.log("Hello World");
}
💡 Pro Tip:
Specify the language after the opening backticks for syntax highlighting. Common languages: javascript, python, html, css, bash, json, markdown.
📊 Tables
Markdown
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
Alignment:
| Left | Center | Right |
|:-----|:------:|------:|
| L1 | C1 | R1 |
| L2 | C2 | R2 |
Result
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
⚠️ Note:
Use colons (:) in the separator row to align text: :--- for left, :---: for center, ---: for right.
💬 Blockquotes
Markdown
> Single blockquote
> Multi-line
> blockquote
> Nested
>> blockquote
Result
Single blockquote
Multi-line
blockquote
➖ Horizontal Rules
Markdown
---
***
___
Result
⚠️ Note:
All three produce the same result. Requires three or more characters with blank lines before and after.
🔧 Advanced Features
Escape Characters
Markdown
\* Not italic \*
\** Not bold \**
\# Not a header
\[Not a link\](url)
Result
* Not italic *
** Not bold **
# Not a header
[Not a link](url)
** Not bold **
# Not a header
[Not a link](url)
HTML in Markdown
Markdown
You can use HTML tags.
Collapsible section
Hidden content hereResult
You can use HTML tags.
Collapsible section
Hidden content here
Line Breaks
Markdown
Line 1
Line 2 (two spaces after Line 1)
Line 1
Line 2 (HTML break)
Line 2 (HTML break)
Result
Line 1
Line 2 (two spaces after Line 1)
Line 1
Line 2 (HTML break)
Line 2 (two spaces after Line 1)
Line 1
Line 2 (HTML break)
Footnotes
Markdown
Here's a sentence with a footnote[^1].
[^1]: This is the footnote.
Result
Here's a sentence with a footnote1.
1. This is the footnote.
1. This is the footnote.
📋 Markdown Flavors Comparison
| Feature | CommonMark | GitHub | GitLab |
|---|---|---|---|
| Basic Syntax | ✅ | ✅ | ✅ |
| Tables | ❌ | ✅ | ✅ |
| Task Lists | ❌ | ✅ | ✅ |
| Strikethrough | ❌ | ✅ | ✅ |
| Auto-linking | Limited | ✅ | ✅ |
| Emoji | ❌ | ✅ :emoji: | ✅ :emoji: |
| Syntax Highlighting | ❌ | ✅ | ✅ |
💡 Best Practices
1. Consistent Style
Choose one style for bullets, emphasis, and stick with it throughout your document.
2. Blank Lines
Use blank lines to separate paragraphs, lists, and code blocks for better readability.
3. Code Language
Always specify the language in code blocks for proper syntax highlighting.
4. Alt Text
Always provide descriptive alt text for images for accessibility.
5. Link Titles
Add hover titles to links when additional context is helpful.
6. Table Alignment
Align table columns consistently for better visual organization.
🚫 Common Mistakes
| Mistake | Wrong | Correct |
|---|---|---|
| Missing space after # | #Header |
# Header |
