Markdown Cheat Sheet
Complete markdown syntax reference with copy-paste examples. Quick lookup for formatting, tables, lists, links, code blocks, and LaTeX equations. Find exactly what you need instantly.
Headings
Create titles and sections using # through ######.
# H1 Heading ## H2 Heading ### H3 Heading #### H4 Heading ##### H5 Heading ###### H6 Heading
H1 Heading
H2 Heading
H3 Heading
H4 Heading
H5 Heading
H6 Heading
Alternative Heading Syntax
Use underlines with = and - for H1 and H2.
Heading 1 ========= Heading 2 ---------
Heading 1
Heading 2
Bold Text
Make text bold with ** or __.
**This is bold** __This is also bold__
This is bold This is also bold
Italic Text
Make text italic with * or _.
*This is italic* _This is also italic_
This is italic This is also italic
Bold and Italic
Combine bold and italic with *** or ___.
***Bold and italic*** ___Bold and italic___ **_Mixed bold italic_** *__Mixed bold italic__*
Bold and italic Bold and italic Mixed bold italic Mixed bold italic
Strikethrough
Strike through text with ~~.
~~Strikethrough text~~ ~~Multiple words strikethrough~~
Strikethrough text
Multiple words strikethrough
Subscript and Superscript
Create subscript and superscript with HTML tags.
H<sub>2</sub>O X<sub>n</sub> X<sup>2</sup> 10<sup>th</sup>
H2O Xn X2 10th
Highlight
Highlight text with == or <mark> tags.
==Highlighted text== <mark>Highlighted with HTML</mark>
==Highlighted text== Highlighted with HTML
Inline Code
Use backticks for inline code.
Use `code` in your sentence. Use ``code with `backticks` inside``
Use code in your sentence.
Use code with `backticks` inside
Links
Create clickable links with optional title.
[Link Text](https://example.com "Optional Title") <https://example.com>
Reference Links
Use reference-style links for cleaner text.
[Link text][reference] [Another link][ref2] [reference]: https://example.com "Title" [ref2]: https://example.com
Automatic Links
Wrap URLs and emails in < > for auto-linking.
<https://example.com> <[email protected]>
https://example.com <[email protected]>
Internal Links
Link to sections within the same document.
[Jump to Section](#section-name) [Go to Headings](#headings)
Images
Embed images with alt text and optional title.
  [](https://stackonlinetools.com) [Reference style][logo] [logo]: https://picsum.photos/seed/picsum/200/200 "Logo Title" <img src="https://picsum.photos/seed/picsum/200/200" width="200" height="100" alt="Sized image"> <img src="https://picsum.photos/seed/picsum/200/200" style="float: right" alt="Floating image">
Unordered Lists
Use -, *, or + to make bullet lists.
- Item 1 - Item 2 - Nested Item * Item 3 + Item 4
- Item 1
- Item 2
- Nested Item
- Item 3
- Item 4
Ordered Lists
Prefix items with numbers for ordered lists.
1. First 2. Second 3. Third 1. Nested 2. Nested
- First
- Second
- Third
- Nested
- Nested
Task Lists
Track tasks with [ ] and [x] checkboxes.
- [x] Done item - [ ] Pending item - [ ] Another task
- Done item
- Pending item
- Another task
Definition Lists
Create term and definition pairs.
First Term : Definition of first term Second Term : First definition : Second definition
First Term : Definition of first term
Second Term : First definition : Second definition
Blockquotes
Quote text with > at the start of the line.
> This is a blockquote > > - Can contain lists > - And other markdown
This is a blockquote
- Can contain lists
- And other markdown
Nested Blockquotes
Nest blockquotes with multiple > symbols.
> First level quote > >> Nested quote >> >>> Third level
First level quote
Nested quote
Third level
Blockquotes with Elements
Include other markdown elements in blockquotes.
> ### Quote with heading > > - List item 1 > - List item 2 > > **Bold text** in quote
Quote with heading
- List item 1
- List item 2
Bold text in quote
Horizontal Rule
Separate sections with --- or *** or ___.
--- *** ___
Line Breaks
Add two spaces at line end or use <br> for a break.
First line Second line (two spaces at end) Or use HTML:<br> Line with HTML break
First line
Second line (two spaces at end)
Or use HTML:
Line with HTML break
Paragraphs
Separate paragraphs with blank lines.
This is the first paragraph. This is the second paragraph. This is the third paragraph.
This is the first paragraph.
This is the second paragraph.
This is the third paragraph.
Code Blocks
Fence blocks with triple backticks and optional language.
```js
function greet(name) {
console.log(`Hello, ${name}`);
}
```function greet(name) {
console.log(`Hello, ${name}`);
}
Indented Code Blocks
Indent with 4 spaces or 1 tab for code blocks.
// Code block with indentation
function example() {
return true;
}// Code block with indentation
function example() {
return true;
}
JavaScript Code Block
Syntax highlighting for JavaScript.
```javascript
// JavaScript Example
function greeting(name) {
return `Hello, ${name}!`;
}
const result = greeting('World');
console.log(result);
```// JavaScript Example
function greeting(name) {
return `Hello, ${name}!`;
}
const result = greeting('World');
console.log(result);
Python Code Block
Syntax highlighting for Python.
```python
# Python Example
def fibonacci(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a + b
```# Python Example
def fibonacci(n):
a, b = 0, 1
while a < n:
print(a, end=' ')
a, b = b, a + b
CSS Code Block
Syntax highlighting for CSS.
```css
/* CSS Example */
.container {
display: flex;
justify-content: center;
align-items: center;
}
```/* CSS Example */
.container {
display: flex;
justify-content: center;
align-items: center;
}
JSON Code Block
Syntax highlighting for JSON.
```json
{
"name": "Example",
"version": "1.0.0",
"dependencies": {
"package": "^1.0.0"
}
}
```{
"name": "Example",
"version": "1.0.0",
"dependencies": {
"package": "^1.0.0"
}
}
Bash/Shell Code Block
Syntax highlighting for shell commands.
```bash # Install dependencies npm install # Run the application npm start ```
# Install dependencies
npm install
# Run the application
npm start
TypeScript Code Block
Syntax highlighting for TypeScript.
```typescript
interface User {
name: string;
email: string;
age?: number;
}
const user: User = {
name: "John",
email: "[email protected]"
};
```interface User {
name: string;
email: string;
age?: number;
}
const user: User = {
name: "John",
email: "[email protected]"
};
HTML Code Block
Syntax highlighting for HTML.
```html <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>Hello World</h1> </body> </html> ```
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
Basic Tables
Create pipe tables with header and rows.
| Header 1 | Header 2 | Header 3 | |----------|----------|----------| | Cell 1 | Cell 2 | Cell 3 | | Row 2 | Data | Data |
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Cell 1 | Cell 2 | Cell 3 |
| Row 2 | Data | Data |
Table Alignment
Use :---, :---:, ---: for left/center/right alignment.
| Left | Center | Right | |:-----|:------:|------:| | Left | Center | Right | | Text | Text | Text |
| Left | Center | Right |
|---|---|---|
| Left | Center | Right |
| Text | Text | Text |
Complex Tables
Showcase a richer table with emojis and varied content.
| Feature | Basic | Pro | Enterprise | |----------------|-------------|------------|---------------| | Storage | 10 GB ⚡ | 100 GB 🚀 | Unlimited 💫 | | Users | 1 | 10 | Unlimited | | Speed | Standard | Fast | Fastest | | Support | ✅ | ✅ | ✅ | | Custom Theme | ❌ | ✅ | ✅ |
| Feature | Basic | Pro | Enterprise |
|---|---|---|---|
| Storage | 10 GB ⚡ | 100 GB 🚀 | Unlimited 💫 |
| Users | 1 | 10 | Unlimited |
| Speed | Standard | Fast | Fastest |
| Support | ✅ | ✅ | ✅ |
| Custom Theme | ❌ | ✅ | ✅ |
Tables with LaTeX
Mix math equations inline with table cells.
| Variable | Formula | Value |
|:---------|:--------|------:|
| Energy | $E = mc^2$ | 9.0 × 10^16 J |
| Force | $F = ma$ | 100 N |
| Sum | $\sum_{i=1}^n i$ | 5050 || Variable | Formula | Value |
|---|---|---|
| Energy | 9.0 × 10^16 J | |
| Force | 100 N | |
| Sum | 5050 |
Inline Math
Add inline math equations with single $.
The equation $E = mc^2$ shows mass-energy equivalence. Pythagorean theorem: $a^2 + b^2 = c^2$
The equation shows mass-energy equivalence.
Pythagorean theorem:
Block Math Equations
Display math equations on their own line with $$.
$$
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
$$
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$Math Systems of Equations
Write systems of equations and cases.
$$
\begin{cases}
x + y = 10 \\
2x - y = 5
\end{cases}
$$Math Matrices
Create matrices and arrays with LaTeX.
$$
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{matrix}
$$
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$Advanced LaTeX Equations
Complex mathematical expressions with integrals, limits, and summations.
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
$$
\lim_{x \to \infty} \frac{1}{x} = 0
$$
$$
\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}
$$
$$
\alpha + \beta = \gamma
$$Footnotes
Add footnotes with [^label] syntax.
Here's a sentence with a footnote.[^1] Another reference.[^note] [^1]: This is the footnote. [^note]: Named footnote.
Emoji
Use emoji shortcodes or Unicode characters.
:smile: :heart: :thumbsup: Or direct: 😀 ❤️ 👍
:smile: :heart: :thumbsup:
Or direct: 😀 ❤️ 👍
Escaping Characters
Use backslash to escape special characters.
\* Not italic \* \# Not a heading \[Not a link\](url) \`Not code\`
* Not italic * # Not a heading [Not a link](url) `Not code`
HTML Elements
Use raw HTML for advanced formatting.
<div style="background: #f0f0f0; padding: 10px;"> <p>Custom HTML content</p> </div> <details> <summary>Click to expand</summary> Hidden content here </details>
Custom HTML content
Click to expand
Hidden content hereComments
Add hidden comments using HTML syntax.
<!-- This is a comment --> Visible text <!-- This won't appear in output -->
Visible text
Badges
Add badges using image links (shields.io).
  
Collapsible Sections
Create expandable sections with <details>.
<details> <summary>Click to expand</summary> ## Hidden Content This content is hidden until clicked. - Item 1 - Item 2 </details>
Click to expand
Hidden Content
This content is hidden until clicked.
- Item 1
- Item 2
Keyboard Keys
Display keyboard keys with <kbd> tags.
Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy. Use <kbd>⌘</kbd> + <kbd>V</kbd> to paste on Mac.
Press Ctrl + C to copy.
Use ⌘ + V to paste on Mac.
Abbreviations
Define abbreviations with hover text.
The HTML specification is maintained by the W3C. *[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium
The HTML specification is maintained by the W3C.
*[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium
Colored Text
Add colored text using HTML/CSS.
<span style="color: red">Red text</span> <span style="color: #0066cc">Blue text</span> <span style="color: green">Green text</span>
Red text Blue text Green text
Custom Anchors
Create custom anchor points for linking.
<a name="custom-anchor"></a>
## Section Title {#custom-id}
[Link to anchor](#custom-anchor)
[Link to section](#custom-id)Alerts and Callouts
Create colored alert boxes with blockquotes and emoji.
> ℹ️ **Note** > This is an informational note. > ⚠️ **Warning** > This is a warning message. > ✅ **Success** > Operation completed successfully. > ❌ **Error** > An error occurred.
ℹ️ Note This is an informational note.
⚠️ Warning This is a warning message.
✅ Success Operation completed successfully.
❌ Error An error occurred.
GitHub Specific Features
Special Markdown features for GitHub.
- [x] Task list item - [ ] Open task - [x] Completed task ```diff - removed line + added line ``` > **Note** > Special callout syntax > **Warning** > Warning callout
- Task list item
- Open task
- Completed task
- removed line
+ added line
Note Special callout syntax
Warning Warning callout
Mermaid Diagrams
Create flowcharts and diagrams with Mermaid syntax.
```mermaid
graph TD;
A[Start] --> B{Decision};
B -->|Yes| C[Action 1];
B -->|No| D[Action 2];
C --> E[End];
D --> E;
```graph TD;
A[Start] --> B{Decision};
B -->|Yes| C[Action 1];
B -->|No| D[Action 2];
C --> E[End];
D --> E;
Sequence Diagrams
Create sequence diagrams with Mermaid.
```mermaid
sequenceDiagram
participant User
participant Server
User->>Server: Request
Server-->>User: Response
```sequenceDiagram
participant User
participant Server
User->>Server: Request
Server-->>User: Response
Academic Writing Template
Starter outline for research papers with sections and math.
# Research Paper Title
## Abstract
Research summary...
## Introduction
### Background
Background information...
### Literature Review
Previous research...
## Methodology
### Research Design
- Data collection
- Analysis
- Results
### Data Analysis
$$\chi^2 = \sum\frac{(O_i-E_i)^2}{E_i}$$
## Results
| Variable | Group A | Group B |
|----------|---------|---------|
| X | 10.5 | 11.2 |
| Y | 20.1 | 19.8 |
## References
[^1]: Author, A. (2023). Title...Research Paper Title
Abstract
Research summary...
Introduction
Background
Background information...
Literature Review
Previous research...
Methodology
Research Design
- Data collection
- Analysis
- Results
Data Analysis
Results
| Variable | Group A | Group B |
|---|---|---|
| X | 10.5 | 11.2 |
| Y | 20.1 | 19.8 |
References
API Documentation Template
Document API endpoints, parameters, and responses.
# API Documentation
## Authentication
```http
Authorization: Bearer <token>
```
## Endpoints
### GET /api/users
Retrieve users list.
#### Parameters
| Name | Type | Description |
|------|------|-------------|
| page | number | Page number |
| limit | number | Items per page |
#### Response
```json
{
"users": [],
"total": 100
}
```
### POST /api/users
Create new user.
#### Request Body
```typescript
interface CreateUser {
name: string;
email: string;
}
```
#### Error Codes
| Code | Description |
|------|-------------|
| 400 | Bad Request |
| 401 | Unauthorized |API Documentation
Authentication
Authorization: Bearer <token>
Endpoints
GET /api/users
Retrieve users list.
Parameters
| Name | Type | Description |
|---|---|---|
| page | number | Page number |
| limit | number | Items per page |
Response
{
"users": [],
"total": 100
}
POST /api/users
Create new user.
Request Body
interface CreateUser {
name: string;
email: string;
}
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
README Template
Complete project README with badges and sections.
# Project Name   ## Getting Started ```bash npm install my-project npm start ``` ## Features ✨ Feature 1 🚀 Feature 2 💫 Feature 3 ## Documentation See our [documentation](/docs) for more details. ## Contributing Please read [CONTRIBUTING.md](CONTRIBUTING.md) ## License MIT © [Your Name]
Project Name
Getting Started
npm install my-project
npm start
Features
✨ Feature 1 🚀 Feature 2 💫 Feature 3
Documentation
See our documentation for more details.
Contributing
Please read CONTRIBUTING.md
License
MIT © [Your Name]
Blog Post Template
Format blog posts with frontmatter and structure.
---
title: "Blog Post Title"
date: 2024-01-01
author: "Your Name"
tags: ["tech", "tutorial"]
---
# Eye-catching Title

## Introduction
Engaging opening paragraph...
### Key Points
1. First point with **emphasis**
2. Second point with *style*
> Quotable highlight text
## Code Example
```python
def example():
print("Hello, readers!")
```
### Summary
Key takeaways...title: "Blog Post Title" date: 2024-01-01 author: "Your Name" tags: ["tech", "tutorial"]
Eye-catching Title
Introduction
Engaging opening paragraph...
Key Points
- First point with emphasis
- Second point with style
Quotable highlight text
Code Example
def example():
print("Hello, readers!")
Summary
Key takeaways...
Markdown Table Creation – Pro Tips
Best practices for creating readable tables.
## Basic Table | Header 1 | Header 2 | |----------|----------| | Cell 1 | Cell 2 | ## Table with Alignment | Left | Center | Right | |:-----|:------:|------:| | L | C | R | ## Pro Tips - Use a **Table Generator** for complex tables - Align pipes for readability - Test in live preview before finalizing
Basic Table
| Header 1 | Header 2 |
|---|---|
| Cell 1 | Cell 2 |
Table with Alignment
| Left | Center | Right |
|---|---|---|
| L | C | R |
Pro Tips
- Use a Table Generator for complex tables
- Align pipes for readability
- Test in live preview before finalizing
Complete Formatting Examples
Comprehensive formatting examples for common use cases.
# Markdown Formatting Examples
## Text Styles
**Bold text** for emphasis
*Italic text* for subtle emphasis
~~Strikethrough~~ for corrections
`Inline code` for technical terms
## Document Structure
# Main Title
## Section Header
### Subsection
#### Minor Section
## Lists and Tasks
- [x] Completed task
- [ ] Pending task
- Regular bullet point
1. First step
2. Second step
3. Final step
## Quotes and Code
> "Markdown makes writing for the web fast and easy."
```javascript
function hello() {
console.log("Hello, Markdown!");
}
```Markdown Formatting Examples
Text Styles
Bold text for emphasis
Italic text for subtle emphasis
Strikethrough for corrections
Inline code for technical terms
Document Structure
Main Title
Section Header
Subsection
Minor Section
Lists and Tasks
- Completed task
- Pending task
- Regular bullet point
- First step
- Second step
- Final step
Quotes and Code
"Markdown makes writing for the web fast and easy."
function hello() {
console.log("Hello, Markdown!");
}