Markdown Cheat Sheet: Complete Syntax Guide
Complete Markdown syntax reference with examples. Learn headers, lists, links, images, code blocks, and advanced formatting.
Markdown is a lightweight markup language that’s easy to read and write. It’s used everywhere from GitHub README files to documentation sites, blogs, and note-taking apps. This comprehensive cheat sheet covers all the essential Markdown syntax you need.
Headers
Create headers using hash symbols (#). More hashes = smaller header.
# H1 Header
## H2 Header
### H3 Header
#### H4 Header
##### H5 Header
###### H6 Header
Result:
H1 Header
H2 Header
H3 Header
Emphasis
Make text bold, italic, or both.
*Italic text* or _italic text_
**Bold text** or __bold text__
***Bold and italic*** or ___bold and italic___
~~Strikethrough text~~
Result:
- Italic text
- Bold text
- Bold and italic
Strikethrough text
Lists
Unordered Lists
Use -, *, or + for bullet points.
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Item 3
Result:
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Item 3
Ordered Lists
Use numbers followed by periods.
1. First item
2. Second item
1. Nested item 2.1
2. Nested item 2.2
3. Third item
Result:
- First item
- Second item
- Nested item 2.1
- Nested item 2.2
- Third item
Links
Create clickable links with [text](url).
[FreeDataTools.dev](https://freedatatools.dev)
[Link with title](https://freedatatools.dev "Visit our site")
Result:
Reference-Style Links
[Link text][reference]
[reference]: https://freedatatools.dev "Optional title"
Images
Similar to links, but with an exclamation mark at the start.


Code
Inline Code
Use backticks for inline code.
Use the `console.log()` function to debug.
Code Blocks
Use triple backticks for code blocks. Add language for syntax highlighting.
```javascript
function greet(name) {
console.log(`Hello, ${name}!`);
}
```
Result:
function greet(name) {
console.log(`Hello, ${name}!`);
}
Blockquotes
Use > for blockquotes.
> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes are also possible.
Result:
This is a blockquote. It can span multiple lines.
Nested blockquotes are also possible.
Horizontal Rules
Create horizontal lines with three or more hyphens, asterisks, or underscores.
---
***
___
Result:
Tables
Create tables using pipes and hyphens.
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Row 1 | Data | Data |
| Row 2 | Data | Data |
Result:
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Row 1 | Data | Data |
| Row 2 | Data | Data |
Table Alignment
Use colons to align columns.
| Left | Center | Right |
|:-----|:------:|------:|
| L | C | R |
Task Lists
Create checkboxes with - [ ] and - [x].
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task
Result:
- Completed task
- Incomplete task
- Another task
Escaping Characters
Use backslash to escape Markdown characters.
\*This text is not italic\*
\# This is not a header
HTML in Markdown
You can use HTML tags directly in Markdown.
<div style="color: blue;">
This text is blue.
</div>
<details>
<summary>Click to expand</summary>
Hidden content here.
</details>
Advanced Features
Footnotes
Here's a sentence with a footnote[^1].
[^1]: This is the footnote content.
Definition Lists
Term
: Definition of the term
Another term
: Another definition
Abbreviations
The HTML specification is maintained by the W3C.
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
GitHub Flavored Markdown (GFM)
Syntax Highlighting
Specify language for code blocks:
```python
def hello():
print("Hello, World!")
```
Emoji
Use :emoji_name: for emoji.
:smile: :heart: :rocket:
Mentions and References
@username
#123 (issue reference)
SHA: a5c3785ed8d6a35868bc169f07e40e889087fd2e
Best Practices
- Use consistent formatting - Pick one style for lists, emphasis, etc.
- Add blank lines - Separate blocks with blank lines for readability
- Use meaningful link text - Avoid “click here”
- Include alt text for images - Important for accessibility
- Preview before publishing - Use a Markdown preview tool
- Keep lines short - Aim for 80-100 characters per line
- Use headers hierarchically - Don’t skip levels (H1 → H3)
Markdown Preview
Test your Markdown syntax with our live preview tool
Common Use Cases
README Files
# Project Name
Brief description of your project.
## Installation
\`\`\`bash
npm install project-name
\`\`\`
## Usage
\`\`\`javascript
const project = require('project-name');
\`\`\`
## License
MIT
Documentation
## API Reference
### `functionName(param1, param2)`
Description of the function.
**Parameters:**
- `param1` (string): Description
- `param2` (number): Description
**Returns:** Description of return value
**Example:**
\`\`\`javascript
functionName('hello', 42);
\`\`\`
Blog Posts
---
title: My Blog Post
date: 2025-01-15
tags: [markdown, blogging]
---
# My Blog Post
Introduction paragraph...
## Section 1
Content here...
Markdown Flavors
Different platforms support different Markdown features:
- CommonMark - Standard specification
- GitHub Flavored Markdown (GFM) - GitHub’s version
- Markdown Extra - PHP Markdown with extensions
- MultiMarkdown - Adds tables, footnotes, citations
- R Markdown - For R programming and data science
Tools and Editors
- VS Code - Built-in Markdown preview
- Typora - WYSIWYG Markdown editor
- Obsidian - Note-taking with Markdown
- HackMD - Collaborative Markdown editor
- Dillinger - Online Markdown editor
HTML to Markdown Converter
Already have HTML content? Convert it to Markdown instantly
Quick Reference Table
| Element | Syntax |
|---|---|
| Header | # H1 to ###### H6 |
| Bold | **text** or __text__ |
| Italic | *text* or _text_ |
| Link | [text](url) |
| Image |  |
| Code | `code` |
| Code Block | ```language |
| List | - item or 1. item |
| Blockquote | > quote |
| Horizontal Rule | --- |
| Table | ` |
Conclusion
Markdown is an essential skill for developers, technical writers, and content creators. Its simplicity and readability make it perfect for documentation, README files, and content management. Bookmark this cheat sheet and refer back whenever you need a quick syntax reminder!
Related Resources
- Markdown Preview Tool - Test your Markdown live
- HTML to Markdown Converter - Convert existing HTML
- CommonMark Specification - Official spec
- GitHub Flavored Markdown - GFM spec