The Ultimate Markdown Cheat Sheet: From Beginner to Expert
This comprehensive Markdown cheat sheet covers everything from basic syntax to advanced features. Pair it with Markdown2Image to create professional-grade technical documentation, tutorials, and shareable graphics.
- Complete Syntax Coverage - From basic formatting to advanced features
- Real-World Examples - Every syntax element includes practical use cases
- Professional Export Ready - Perfectly optimized for Markdown2Image conversion
- Cross-Platform Compatible - Works flawlessly across all major Markdown renderers
- Best Practices Included - Industry-standard formatting guidelines
*Italic text* for gentle emphasis
**Bold text** for strong emphasis
***Bold italic*** for maximum emphasis
`Inline code` for technical terms and commands
~~Strikethrough text~~ for deprecated content
Practical Applications:
- Important Note: Please read the following information carefully
- Attention: This feature is still in beta testing
Command Format:npm install package-nameDeprecated: This method is no longer recommended in new versions
==Highlighted text== for platform-specific underline markup
<u>Underlined text</u> for universal underline syntax
^[Superscript text^] for elevated content
~[Subscript text]~ for lowered content
[Regular link](https://example.com)
[Link with title tooltip](https://example.com "Hover to see title")
[Relative path link](../other-file.md)
[Anchor link](#section-name)
[Email link](mailto:[email protected])
[Phone link](tel:+1234567890)
[Download link](download/file.pdf "Click to download PDF file")
[External link in new window](https://example.com){target="_blank"}
[Secure link](https://example.com){rel="noopener noreferrer"}
First, define references in your document:
[GitHub]: https://github.com "World's largest code hosting platform"
[Google]: https://google.com "World's largest search engine"
[Stack Overflow]: https://stackoverflow.com "Programming Q&A community"
Then use them throughout your text:
Visit [GitHub], [Google], and [Stack Overflow] for comprehensive resources.
This approach keeps documents clean and makes link management much more efficient.






{data-zoomable}
{align=center}
{align=left}
{align=right}

*Figure 1: Complete workflow diagram showing the end-to-end process from data input to result output*
> **💡 Pro Tip**: In Markdown2Image, images are automatically optimized and maintain high-quality output.
- Primary task 1
- Subtask 1.1
- Subtask 1.2
- Primary task 2
- Subtask 2.1
- Primary task 3
1. First step: Project initialization
2. Second step: Environment setup
1. Install dependencies
2. Configure database
3. Set environment variables
3. Third step: Feature development
4. Fourth step: Testing and deployment
- [x] Completed task
- [ ] In-progress task
- [ ] Pending task
- [x] Another completed task
- [x] Project architecture design
- [x] Technology selection
- [x] Database design
- [ ] API design
- [ ] Frontend framework selection
- [ ] Core feature development
- [ ] User authentication module
- [ ] Data processing module
- [ ] Report generation module
- [ ] User interface components
- [ ] Testing and quality assurance
- [ ] Unit tests
- [ ] Integration tests
- [ ] User acceptance testing
Markdown
: A lightweight markup language for formatting plain text documents
CMS (Content Management System)
: Software platform for creating, managing, and publishing digital content
API (Application Programming Interface)
: Specification that defines how software components should interact
IDE (Integrated Development Environment)
: Software application that provides comprehensive facilities to programmers for software development
# Level 1 Heading (H1) - Document main title
## Level 2 Heading (H2) - Major sections
### Level 3 Heading (H3) - Subsections
#### Level 4 Heading (H4) - Detailed content
##### Level 5 Heading (H5) - Specific details
###### Level 6 Heading (H6) - Finest granularity
- Use only one H1 per document as the main document title
- Maintain hierarchical continuity - don't skip heading levels
- Keep headings concise and descriptive - accurately summarize paragraph content
- Use structured heading format - "Action + Object" pattern (e.g., "Install Python Environment")
- Include keywords for better SEO and discoverability
> This is a blockquote used to highlight important content or cite other people's perspectives.
> Blockquotes can span multiple lines while maintaining original formatting and structure.
>
> You can use other Markdown syntax within blockquotes, such as **bold text** and `inline code`.
> Outer level quote content
>> Inner level quote content
>>> Deeper nested quote content
>>>> Deepest level quote content
> Good code is not just code that runs, but code that is easy to understand, maintain, and extend.
>
> — Robert C. Martin, "Clean Code"
> Genius is 1% inspiration and 99% perspiration.
>
> — Thomas Edison
> The only way to do great work is to love what you do.
> If you haven't found it yet, keep looking. Don't settle.
>
> — Steve Jobs
Use `print()` function for output in Python.
Database connection string example: `"Server=localhost;Database=test;"`
Git commit message: `git commit -m "Add user authentication feature"`
// JavaScript example with modern ES6+ features
function calculateTotal(items, taxRate = 0.08) {
const subtotal = items.reduce((sum, item) => {
return sum + (item.price * item.quantity);
}, 0);
const tax = subtotal * taxRate;
return {
subtotal,
tax,
total: subtotal + tax
};
}
const shoppingCart = [
{ name: "Apple", price: 5.99, quantity: 3 },
{ name: "Banana", price: 2.49, quantity: 5 },
{ name: "Orange", price: 3.99, quantity: 2 }
];
const result = calculateTotal(shoppingCart);
console.log(`Subtotal: $${result.subtotal.toFixed(2)}`);
console.log(`Tax: $${result.tax.toFixed(2)}`);
console.log(`Total: $${result.total.toFixed(2)}`);
# Python example with comprehensive error handling
def calculate_average(numbers):
"""Calculate the average of a list of numbers with error handling."""
if not numbers:
raise ValueError("Cannot calculate average of empty list")
if not all(isinstance(num, (int, float)) for num in numbers):
raise TypeError("All elements must be numbers")
return sum(numbers) / len(numbers)
# Example usage with try-catch
scores = [85, 92, 78, 95, 88, 76, 89]
try:
average = calculate_average(scores)
print(f"Average score: {average:.2f}")
print(f"Number of scores: {len(scores)}")
except ValueError as e:
print(f"Error: {e}")
except TypeError as e:
print(f"Error: {e}")
# Shell script example with comprehensive automation
#!/bin/bash
# Automated deployment script with error handling
set -e # Exit on any error
# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Logging functions
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Deployment process
main() {
log_info "Starting application deployment..."
# Check git status
if ! git status; then
log_error "Git repository not found"
exit 1
fi
# Pull latest changes
log_info "Pulling latest changes from origin/main..."
git pull origin main
# Install dependencies
log_info "Installing dependencies..."
if [ -f "package.json" ]; then
npm ci
else
log_warn "No package.json found, skipping npm install"
fi
# Run build process
log_info "Building application..."
if [ -f "package.json" ] && grep -q '"build"' package.json; then
npm run build
else
log_warn "No build script found, skipping build"
fi
# Start application
log_info "Starting application..."
if [ -f "package.json" ] && grep -q '"start"' package.json; then
npm start
else
log_info "Deployment completed successfully!"
fi
}
# Execute main function
main "$@"
-- SQL query example with complex joins and aggregations
SELECT
u.id,
u.name,
u.email,
u.created_at,
COUNT(o.id) as order_count,
SUM(CASE WHEN o.status = 'completed' THEN o.total ELSE 0 END) as completed_total,
SUM(CASE WHEN o.status = 'pending' THEN o.total ELSE 0 END) as pending_total,
AVG(o.total) as average_order_value,
MAX(o.created_at) as last_order_date
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.created_at >= '2024-01-01'
AND u.is_active = true
GROUP BY u.id, u.name, u.email, u.created_at
HAVING COUNT(o.id) > 0
ORDER BY completed_total DESC, average_order_value DESC
LIMIT 10;
| Name | Age | City | Occupation | Join Date |
|------|------|------|------------|----------|
| John Smith | 28 | New York | Software Engineer | 2023-03-15 |
| Sarah Johnson | 32 | San Francisco | Product Manager | 2023-02-20 |
| Mike Davis | 25 | Austin | UX Designer | 2023-04-10 |
| Emily Wilson | 30 | Seattle | Data Scientist | 2023-01-08 |
| Left Aligned | Center Aligned | Right Aligned |
|:-------------|:---------------|:--------------|
| Text content | Numeric data | Currency values |
| Longer text content | Centered display | Right-aligned amounts |
| Category names | Percentage values | Financial totals |
| Product Name | Price | Stock | Status | Rating | Last Updated |
|-------------|-------|-------|---------|--------|--------------|
| MacBook Pro 16" | $1,999 | 15 | ✅ Available | 4.8/5 | 2024-01-15 |
| iPhone 15 Pro | $999 | 0 | ❌ Out of Stock | 4.9/5 | 2024-01-14 |
| iPad Air | $599 | 8 | ⚠️ Low Stock | 4.6/5 | 2024-01-13 |
| AirPods Pro | $249 | 25 | ✅ Available | 4.7/5 | 2024-01-12 |
| Apple Watch | $399 | 12 | ✅ Available | 4.5/5 | 2024-01-11 |
**Status Legend:**
- ✅ Available: Sufficient stock, normal sales
- ❌ Out of Stock: Temporarily unavailable, restocking next week
- ⚠️ Low Stock: Limited inventory, recommend prompt restocking
- 🚨 Discontinued: No longer manufactured
**Rating System:**
- 4.5-5.0: Excellent product, highly recommended
- 4.0-4.4: Good product, meets expectations
- 3.5-3.9: Average product, some limitations
- Below 3.5: Below average, consider alternatives
| Metric | Q1 2024 | Q2 2024 | Q3 2024 | Q4 2024 | YTD Total |
|--------|----------|----------|----------|----------|-----------|
| Revenue | $125,000 | $142,000 | $168,000 | $195,000 | $630,000 |
| Expenses | $45,000 | $52,000 | $58,000 | $65,000 | $220,000 |
| Profit | $80,000 | $90,000 | $110,000 | $130,000 | $410,000 |
| Margin | 64% | 63.4% | 65.5% | 66.7% | 65.1% |
**Financial Highlights:**
- **Year-over-year growth**: 28% increase from 2023
- **Profit margin target**: Maintain 65% average
- **Q4 strongest**: Seasonal peak in Q4 performance
---
***
___
\* Display asterisk without italic formatting
\` Display backtick without code formatting
\# Display hash symbol without creating heading
\\ Display backslash character
\@ Display at symbol without mentioning users
\( and \) Display parentheses without creating links
\[ and \] Display square brackets without creating links
<details>
<summary>Click to expand detailed information</summary>
This hidden content can be revealed by clicking the summary above.
Perfect for including technical details, configuration information,
expanded examples, or supplementary content.
You can include any Markdown content here:
- Code blocks
- Lists
- Tables
- Images
</details>
<kbd>Ctrl</kbd> + <kbd>C</kbd> to copy
<kbd>Cmd</kbd> + <kbd>V</kbd> to paste
<kbd>Ctrl</kbd> + <kbd>Z</kbd> to undo
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Z</kbd> to redo
:smile: 😊 :heart: ❤️ :rocket: 🚀 :star: ⭐
:warning: ⚠️ :information_source: ℹ️ :question: ❓
:check_mark: ✅ :x: ❌ :plus: ➕
:arrow_right: → :arrow_left: ← :arrow_up: ↑ :arrow_down: ↓
# Custom emoji with specific names
:custom_emoji: :project_logo: :team_icon:
Inline mathematics: $E = mc^2$
Display mathematics:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
Mathematical formulas:
$$
a^2 + b^2 = c^2 \\\n\text{Area of circle} = \pi r^2
$$
Statistical notation:
$$
\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i \\\n\sigma = \sqrt{\frac{1}{n-1} \sum_{i=1}^{n} (x_i - \bar{x})^2}
$$
- Clear Structure: Use distinct heading levels and maintain logical flow
- Concise Content: Avoid excessively long paragraphs, use lists and tables appropriately
- Code Optimization: Use syntax highlighting and choose appropriate font sizes
- Image Quality: Ensure images are high-resolution with descriptive alt text
- Color Contrast: Ensure sufficient contrast between text and background
- Consistent Spacing: Use consistent margins and padding
- Format Selection:
- PNG: Best for most purposes, universal compatibility
- SVG: Ideal for vector graphics and scalability
- JPEG: Good for photographs, smaller file sizes
- Size Recommendations:
- Social media sharing: 1200x630px (landscape) or 1080x1080px (square)
- Technical documentation: 1920x1080px or higher for detailed content
- Mobile-optimized: 1080x1920px for portrait orientation
- Email newsletters: 600px width for responsive design
- Typography Guidelines:
- Body text: 14-16px for optimal readability
- Code blocks: 12-14px for syntax highlighting clarity
- Headings: 18-24px for clear hierarchy
- Line spacing: 1.5-1.7x for comfortable reading
- Color Schemes: Consider accessibility and brand guidelines
# API Documentation
## Authentication
### Request Example
```bash
curl -X POST https://api.example.com/auth/login \
-H "Content-Type: application/json" \
-H "User-Agent: MyApp/1.0" \
-d '{"username":"developer","password":"secure_password"}'
{
"status": "success",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"user": {
"id": 123,
"username": "developer",
"email": "[email protected]",
"role": "admin",
"permissions": ["read", "write", "delete"]
}
},
"message": "Authentication successful"
}
Retrieve all users with pagination and filtering.
Parameters:
page(optional): Page number (default: 1)limit(optional): Items per page (default: 20, max: 100)search(optional): Search term for username/emailrole(optional): Filter by user rolestatus(optional): Filter by account status
Response:
{
"users": [
{
"id": 1,
"username": "johndoe",
"email": "[email protected]",
"role": "user",
"created_at": "2024-01-15T10:30:00Z",
"last_login": "2024-01-20T14:25:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"pages": 8
}
}
Create a new user account.
Request Body:
{
"username": "newuser",
"email": "[email protected]",
"password": "secure_password",
"role": "user"
}
Error Responses:
{
"error": "Validation failed",
"details": {
"username": ["Username must be unique"],
"email": ["Invalid email format"]
}
}
# Quick Start Guide
## Prerequisites
Before you begin, ensure you have:
- A modern web browser (Chrome, Firefox, Safari, Edge)
- Basic command line knowledge
- A code editor (VS Code, Sublime Text, or similar)
- Node.js 16+ installed
## Step 1: Environment Setup
### Install Required Software
```bash
# Check Node.js version
node --version
# Should show v16.0.0 or higher
# Check npm version
npm --version
# Should show 8.0.0 or higher
# If not installed, download from nodejs.org
# Create project directory
mkdir my-awesome-project
cd my-awesome-project
# Initialize npm project
npm init -y
# Install essential dependencies
npm install express mongoose dotenv
npm install -D nodemon typescript @types/node
# Create basic project structure
mkdir src
mkdir public
touch src/server.js src/db.js
# Create environment file
echo "NODE_ENV=development" > .env
echo "PORT=3000" >> .env
echo "MONGODB_URI=mongodb://localhost:27017/myapp" >> .env
echo "JWT_SECRET=your-secret-key-here" >> .env
# Create main application file
echo "# My Awesome Project" > README.md
echo "" > src/server.js
# Start with nodemon for auto-reload
npm run dev
# Or start normally
node src/server.js
// Connect to MongoDB
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true
});
// Create user schema
const userSchema = new mongoose.Schema({
username: String,
email: String,
createdAt: { type: Date, default: Date.now }
});
// Create model
const User = mongoose.model('User', userSchema);
# Run tests
npm test
# Check code quality
npm run lint
# Build for production
npm run build
# Find process using port 3000
lsof -ti:3000
# Kill the process
kill -9 <PID>
# Or use different port
PORT=3001 npm start
# Fix file permissions
chmod +x scripts/deploy.sh
# Or run with sudo if necessary
sudo ./scripts/deploy.sh
# Clear npm cache
npm cache clean --force
# Delete node_modules and package-lock.json
rm -rf node_modules package-lock.json
# Reinstall dependencies
npm install
- Bold: Select text →
Ctrl+B/Cmd+B - Italic: Select text →
Ctrl+I/Cmd+I - Code: Select text →
Ctrl+Shift+C/Cmd+Shift+C - Link: Select text →
Ctrl+K/Cmd+K - Quote: Select text →
Ctrl+Shift+Q/Cmd+Shift+Q - List: Select lines →
Ctrl+Shift+L/Cmd+Shift+L
- Create Document Templates: Save frequently used document structures as templates
- Code Snippet Library: Maintain a personal collection of reusable code blocks
- Custom CSS Classes: Use CSS classes for consistent styling
- Automated Workflows: Set up scripts for routine formatting tasks
- Multi-cursor Editing: Edit multiple instances simultaneously
- Column Selection: Select and edit text in columns
- Search and Replace: Use regex for advanced find/replace operations
- Outline Navigation: Use document outline for quick navigation
- Spell Checking: Enable spell checking with technical dictionaries
- Grammar Checking: Use grammar tools for professional writing
- Link Validation: Regularly check and update broken links
- Version Control: Commit frequently with meaningful messages
- Logical Flow: Ensure content follows a logical progression
- Clear Headings: Use descriptive, keyword-rich headings
- Consistent Formatting: Maintain uniform style throughout
- Regular Updates: Keep content current and relevant
- Code Verification: Test all code examples before inclusion
- Command Validation: Verify commands work in target environments
- Version Specificity: Note version-specific requirements
- Platform Considerations: Account for cross-platform differences
- Readability: Use appropriate language complexity for target audience
- Accessibility: Include alt text, proper contrast, and screen reader support
- Mobile Friendly: Ensure content works well on mobile devices
- Navigation: Include internal links for easy document navigation
| Element | Syntax | Example | Output |
|---|---|---|---|
| Bold | **text** | **Important** | Important |
| Italic | *text* | *Note* | Note |
| Code | `code` | `npm` | npm |
| Link | [text](url) | [Website](https://example.com) | Website |
| Image |  |  | ![]() |
| List | - item | - Task | - Task |
| Heading | # title | # Section | # Section |
| Quote | > text | > Tip | > Tip |
| Code block | ```code``` | See above | Formatted block |
| Character | Escape Sequence | Description |
|---|---|---|
| * | \* | Asterisk |
| ` | ` | Backtick |
| # | # | Hash symbol |
| & | & | Ampersand |
| $ | $ | Dollar sign |
| % | % | Percent sign |
| @ | @ | At symbol |
| ( | ( | Opening parenthesis |
| ) | ) | Closing parenthesis |
| [ | [ | Opening bracket |
| ] | ] | Closing bracket |
| Task | Pattern | Description |
|---|---|---|
| Find emails | [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} | Extract email addresses |
| Find URLs | https?://[^\s]+ | Extract web URLs |
| Find phone numbers | `(?:(?:+?1)?[-.\s]?((?:(\d{3})) | ((\d{3})))[-.\s]?(\d{3})[-.\s]?(\d{4})` |
| Clean whitespace | \s+ | Multiple spaces |
- API reference documentation
- User manuals and guides
- Developer onboarding materials
- README files and project documentation
- Software architecture documents
- Technical blog posts and articles
- Project documentation and specifications
- Product descriptions and user guides
- Knowledge base articles and tutorials
- Release notes and changelogs
- Course outlines and syllabi
- Study notes and flashcards
- Laboratory manuals and guides
- Training materials and workshops
- Academic papers and research
- Project proposals and requirements
- Meeting notes and minutes
- Status reports and dashboards
- Process documentation and workflows
- Business plans and presentations
- Storyboards and scripts
- Game design documents
- Creative briefs and concepts
- Portfolio documentation
- Design specifications
- VS Code: Free with extensive Markdown extensions
- Typora: Beautiful, focused writing experience
- Mark Text: Open source with live preview
- Sublime Text: Lightweight with packages
- Atom: GitHub's Electron-based editor
- iA Writer: Minimalist distraction-free writing
- Dillinger: Browser-based editor with preview
- StackEdit: Collaborative editing with cloud sync
- Markdown Live Preview: Real-time preview with themes
- Notion: Integrated notes with Markdown support
- HackMD: Real-time collaborative editing
- Pandoc: Universal document converter
- Markdown2Image: Image export for sharing
- GitHub Pages: Free hosting from Markdown
- GitLab Pages: Alternative to GitHub Pages
- Netlify: Static site hosting with continuous deployment
- Mermaid Diagrams: Flowcharts and sequence diagrams
- PlantUML: Unified Modeling Language diagrams
- KaTeX: LaTeX mathematical typesetting
- Highlight.js: Syntax highlighting
- Remark: Markdown processor with plugins
- Custom CSS: Styling with CSS
- JavaScript: Dynamic content generation
- Stack Overflow: Programming Q&A with Markdown tags
- Reddit: r/Markdown for discussions and tips
- GitHub: Open source projects with Markdown docs
- Discord: Server communities for support
- Medium: Publishing platform with Markdown support
Mastering Markdown goes beyond memorizing syntax—it's about developing structured thinking and creating professional, accessible content. This comprehensive cheat sheet, combined with Markdown2Image, empowers you to transform any Markdown document into beautiful, shareable graphics that enhance knowledge sharing and technical communication.
Key Takeaways:
- Start with the basics, then gradually incorporate advanced features
- Practice regularly to build muscle memory
- Customize this guide for your specific use cases
- Experiment with different tools to find your perfect workflow
- Share your knowledge and help others learn Markdown
Next Steps:
- Choose a real project and apply these Markdown techniques
- Create your first Markdown2Image export
- Share your work and get feedback from others
- Continue learning and exploring advanced features
Remember: The best Markdown documentation is the kind you actually use and maintain. Start simple, be consistent, and focus on clarity and usefulness over complexity.
💡 Pro Tip: Bookmark this guide and refer to it whenever you need a quick syntax reminder. The table of contents and quick reference cards make it easy to find exactly what you need, when you need it.
🚀 Call to Action: Select one Markdown use case from your current projects, apply the techniques from this guide, and create a professional export with Markdown2Image. Your improved documentation will make technical communication more effective and accessible!
