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.

Filter by Tags:

Headings

Create titles and sections using # through ######.

# H1 Heading
## H2 Heading
### H3 Heading
#### H4 Heading
##### H5 Heading
###### H6 Heading
Rendered output:

H1 Heading

H2 Heading

H3 Heading

H4 Heading

H5 Heading
H6 Heading
formattingheadingsbasicsstructure

Alternative Heading Syntax

Use underlines with = and - for H1 and H2.

Heading 1
=========

Heading 2
---------
Rendered output:

Heading 1

Heading 2

formattingheadingsbasicsalternative

Bold Text

Make text bold with ** or __.

**This is bold**
__This is also bold__
Rendered output:

This is bold This is also bold

formattingemphasisbasicstext

Italic Text

Make text italic with * or _.

*This is italic*
_This is also italic_
Rendered output:

This is italic This is also italic

formattingemphasisbasicstext

Bold and Italic

Combine bold and italic with *** or ___.

***Bold and italic***
___Bold and italic___
**_Mixed bold italic_**
*__Mixed bold italic__*
Rendered output:

Bold and italic Bold and italic Mixed bold italic Mixed bold italic

formattingemphasisbasicstext

Strikethrough

Strike through text with ~~.

~~Strikethrough text~~
~~Multiple words strikethrough~~
Rendered output:

Strikethrough text Multiple words strikethrough

formattingemphasistext

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>
Rendered output:

H2O Xn X2 10th

formattinghtmlscientifictextmath

Highlight

Highlight text with == or <mark> tags.

==Highlighted text==
<mark>Highlighted with HTML</mark>
Rendered output:

==Highlighted text== Highlighted with HTML

formattingemphasistexthtml

Inline Code

Use backticks for inline code.

Use `code` in your sentence.
Use ``code with `backticks` inside``
Rendered output:

Use code in your sentence. Use code with `backticks` inside

codebasicsformatting

Links

Create clickable links with optional title.

[Link Text](https://example.com "Optional Title")
<https://example.com>
linksbasicsformattingnavigation

Reference Links

Use reference-style links for cleaner text.

[Link text][reference]
[Another link][ref2]

[reference]: https://example.com "Title"
[ref2]: https://example.com
Rendered output:
linksadvancednavigation

Automatic Links

Wrap URLs and emails in < > for auto-linking.

<https://example.com>
<[email protected]>
Rendered output:

https://example.com <[email protected]>

linksbasicsnavigation

Internal Links

Link to sections within the same document.

[Jump to Section](#section-name)
[Go to Headings](#headings)
linksnavigationanchors

Images

Embed images with alt text and optional title.

![Alt text](https://picsum.photos/seed/picsum/200/200)
![Alt with title](https://picsum.photos/seed/picsum/200/200 "Image title")
[![Clickable image](https://picsum.photos/seed/picsum/200/200)](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">
Rendered output:

Alt text Alt with title Clickable image

[Reference style][logo] [logo]: https://picsum.photos/seed/picsum/200/200 "Logo Title"

Sized image Floating image
imagesformattingmedia

Unordered Lists

Use -, *, or + to make bullet lists.

- Item 1
- Item 2
  - Nested Item
* Item 3
+ Item 4
Rendered output:
  • Item 1
  • Item 2
    • Nested Item
  • Item 3
  • Item 4
listsbasicsformatting

Ordered Lists

Prefix items with numbers for ordered lists.

1. First
2. Second
3. Third
   1. Nested
   2. Nested
Rendered output:
  1. First
  2. Second
  3. Third
    1. Nested
    2. Nested
listsbasicsformatting

Task Lists

Track tasks with [ ] and [x] checkboxes.

- [x] Done item
- [ ] Pending item
- [ ] Another task
Rendered output:
  • Done item
  • Pending item
  • Another task
liststasksgithub

Definition Lists

Create term and definition pairs.

First Term
: Definition of first term

Second Term
: First definition
: Second definition
Rendered output:

First Term : Definition of first term

Second Term : First definition : Second definition

listsadvancedformatting

Blockquotes

Quote text with > at the start of the line.

> This is a blockquote
>
> - Can contain lists
> - And other markdown
Rendered output:

This is a blockquote

  • Can contain lists
  • And other markdown
blockquotesformattingbasics

Nested Blockquotes

Nest blockquotes with multiple > symbols.

> First level quote
>
>> Nested quote
>>
>>> Third level
Rendered output:

First level quote

Nested quote

Third level

blockquotesadvancedformatting

Blockquotes with Elements

Include other markdown elements in blockquotes.

> ### Quote with heading
>
> - List item 1
> - List item 2
>
> **Bold text** in quote
Rendered output:

Quote with heading

  • List item 1
  • List item 2

Bold text in quote

blockquotesadvancedformatting

Horizontal Rule

Separate sections with --- or *** or ___.

---
***
___
Rendered output:



horizontal-ruleformattingbasics

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
Rendered output:

First line
Second line (two spaces at end)

Or use HTML:
Line with HTML break

formattingline-breaksbasics

Paragraphs

Separate paragraphs with blank lines.

This is the first paragraph.

This is the second paragraph.

This is the third paragraph.
Rendered output:

This is the first paragraph.

This is the second paragraph.

This is the third paragraph.

formattingbasicstext

Code Blocks

Fence blocks with triple backticks and optional language.

```js
function greet(name) {
  console.log(`Hello, ${name}`);
}
```
Rendered output:
function greet(name) {
  console.log(`Hello, ${name}`);
}
codebasicsformatting

Indented Code Blocks

Indent with 4 spaces or 1 tab for code blocks.

    // Code block with indentation
    function example() {
      return true;
    }
Rendered output:
// Code block with indentation
function example() {
  return true;
}
codebasicsformatting

JavaScript Code Block

Syntax highlighting for JavaScript.

```javascript
// JavaScript Example
function greeting(name) {
  return `Hello, ${name}!`;
}
const result = greeting('World');
console.log(result);
```
Rendered output:
// JavaScript Example
function greeting(name) {
  return `Hello, ${name}!`;
}
const result = greeting('World');
console.log(result);
codejavascriptsyntax-highlightingprogramming

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
```
Rendered output:
# Python Example
def fibonacci(n):
    a, b = 0, 1
    while a < n:
        print(a, end=' ')
        a, b = b, a + b
codepythonsyntax-highlightingprogramming

CSS Code Block

Syntax highlighting for CSS.

```css
/* CSS Example */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
}
```
Rendered output:
/* CSS Example */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
}
codecsssyntax-highlightingstyling

JSON Code Block

Syntax highlighting for JSON.

```json
{
  "name": "Example",
  "version": "1.0.0",
  "dependencies": {
    "package": "^1.0.0"
  }
}
```
Rendered output:
{
  "name": "Example",
  "version": "1.0.0",
  "dependencies": {
    "package": "^1.0.0"
  }
}
codejsonsyntax-highlightingdata

Bash/Shell Code Block

Syntax highlighting for shell commands.

```bash
# Install dependencies
npm install

# Run the application
npm start
```
Rendered output:
# Install dependencies
npm install

# Run the application
npm start
codebashshellsyntax-highlightingterminal

TypeScript Code Block

Syntax highlighting for TypeScript.

```typescript
interface User {
  name: string;
  email: string;
  age?: number;
}

const user: User = {
  name: "John",
  email: "[email protected]"
};
```
Rendered output:
interface User {
  name: string;
  email: string;
  age?: number;
}

const user: User = {
  name: "John",
  email: "[email protected]"
};
codetypescriptsyntax-highlightingprogramming

HTML Code Block

Syntax highlighting for HTML.

```html
<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
  <h1>Hello World</h1>
</body>
</html>
```
Rendered output:
<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
  <h1>Hello World</h1>
</body>
</html>
codehtmlsyntax-highlightingmarkup

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     |
Rendered output:
Header 1Header 2Header 3
Cell 1Cell 2Cell 3
Row 2DataData
tablesbasicformatting

Table Alignment

Use :---, :---:, ---: for left/center/right alignment.

| Left | Center | Right |
|:-----|:------:|------:|
| Left | Center | Right |
| Text | Text   | Text  |
Rendered output:
LeftCenterRight
LeftCenterRight
TextTextText
tablesadvancedalignmentformatting

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   | ❌           | ✅         | ✅            |
Rendered output:
FeatureBasicProEnterprise
Storage10 GB ⚡100 GB 🚀Unlimited 💫
Users110Unlimited
SpeedStandardFastFastest
Support
Custom Theme
tablescomplexformattingadvanced

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 |
Rendered output:
VariableFormulaValue
EnergyE=mc2E = mc^29.0 × 10^16 J
ForceF=maF = ma100 N
Sumi=1ni\sum_{i=1}^n i5050
tableslatexmathscientificadvanced

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$
Rendered output:

The equation E=mc2E = mc^2 shows mass-energy equivalence.

Pythagorean theorem: a2+b2=c2a^2 + b^2 = c^2

latexmathequationsscientificbasics

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}
$$
Rendered output:
b±b24ac2a\frac{-b \pm \sqrt{b^2 - 4ac}}{2a} 0ex2dx=π2\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
latexmathequationsscientificbasics

Math Systems of Equations

Write systems of equations and cases.

$$
\begin{cases}
x + y = 10 \\
2x - y = 5
\end{cases}
$$
Rendered output:
{x+y=102xy=5\begin{cases} x + y = 10 \\ 2x - y = 5 \end{cases}
latexmathequationsscientificadvanced

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}
$$
Rendered output:
123456789\begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{matrix} (abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix}
latexmathmatricesscientificadvanced

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
$$
Rendered output:
0ex2dx=π2\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} limx1x=0\lim_{x \to \infty} \frac{1}{x} = 0 n=11n2=π26\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6} α+β=γ\alpha + \beta = \gamma
latexmathequationsscientific

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.
Rendered output:

Here's a sentence with a footnote.1

Another reference.2

Footnotes

  1. This is the footnote.

  2. Named footnote.

formattingreferencesacademic

Emoji

Use emoji shortcodes or Unicode characters.

:smile: :heart: :thumbsup:

Or direct: 😀 ❤️ 👍
Rendered output:

:smile: :heart: :thumbsup:

Or direct: 😀 ❤️ 👍

formattingemojitext

Escaping Characters

Use backslash to escape special characters.

\* Not italic \*
\# Not a heading
\[Not a link\](url)
\`Not code\`
Rendered output:

* Not italic * # Not a heading [Not a link](url) `Not code`

formattingbasicstext

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>
Rendered output:

Custom HTML content

Click to expand Hidden content here
htmladvancedformatting

Comments

Add hidden comments using HTML syntax.

<!-- This is a comment -->

Visible text

<!-- This won't appear in output -->
Rendered output:

Visible text

formattinghtmldocumentation

Badges

Add badges using image links (shields.io).

![Build Status](https://img.shields.io/github/workflow/status/user/repo/CI)
![Version](https://img.shields.io/npm/v/package.svg)
![License](https://img.shields.io/badge/license-MIT-blue.svg)
Rendered output:

Build Status Version License

imagesbadgesgithubdocumentation

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>
Rendered output:
Click to expand

Hidden Content

This content is hidden until clicked.

  • Item 1
  • Item 2
htmladvancedinteractiveformatting

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.
Rendered output:

Press Ctrl + C to copy.

Use + V to paste on Mac.

htmlformattingdocumentation

Abbreviations

Define abbreviations with hover text.

The HTML specification is maintained by the W3C.

*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
Rendered output:

The HTML specification is maintained by the W3C.

*[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium

formattingadvancedtext

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>
Rendered output:

Red text Blue text Green text

htmlformattingcolorstyling

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)
Rendered output:

Section Title {#custom-id}

Link to anchor Link to section

linkshtmlnavigationadvanced

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.
Rendered output:

ℹ️ Note This is an informational note.

⚠️ Warning This is a warning message.

Success Operation completed successfully.

Error An error occurred.

formattingalertscalloutsgithub

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
Rendered output:
  • Task list item
  • Open task
  • Completed task
- removed line
+ added line

Note Special callout syntax

Warning Warning callout

githubadvancedsyntax-highlighting

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;
```
Rendered output:
graph TD;
    A[Start] --> B{Decision};
    B -->|Yes| C[Action 1];
    B -->|No| D[Action 2];
    C --> E[End];
    D --> E;
diagramsmermaidvisualizationadvanced

Sequence Diagrams

Create sequence diagrams with Mermaid.

```mermaid
sequenceDiagram
    participant User
    participant Server
    User->>Server: Request
    Server-->>User: Response
```
Rendered output:
sequenceDiagram
    participant User
    participant Server
    User->>Server: Request
    Server-->>User: Response
diagramsmermaidsequencevisualizationadvanced

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...
Rendered output:

Research Paper Title

Abstract

Research summary...

Introduction

Background

Background information...

Literature Review

Previous research...

Methodology

Research Design

  • Data collection
  • Analysis
  • Results

Data Analysis

χ2=(OiEi)2Ei\chi^2 = \sum\frac{(O_i-E_i)^2}{E_i}

Results

VariableGroup AGroup B
X10.511.2
Y20.119.8

References

academicstructuretemplatelatex

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 |
Rendered output:

API Documentation

Authentication

Authorization: Bearer <token>

Endpoints

GET /api/users

Retrieve users list.

Parameters

NameTypeDescription
pagenumberPage number
limitnumberItems per page

Response

{
  "users": [],
  "total": 100
}

POST /api/users

Create new user.

Request Body

interface CreateUser {
  name: string;
  email: string;
}

Error Codes

CodeDescription
400Bad Request
401Unauthorized
apidocumentationcodetemplatetechnical

README Template

Complete project README with badges and sections.

# Project Name

![Build Status](https://img.shields.io/github/workflow/status/user/repo/CI)
![npm version](https://img.shields.io/npm/v/project.svg)

## 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]
Rendered output:

Project Name

Build Status npm version

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]

githubdocumentationtemplatereadme

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

![Header Image](https://picsum.photos/seed/picsum/800/300)

## 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...
Rendered output:

title: "Blog Post Title" date: 2024-01-01 author: "Your Name" tags: ["tech", "tutorial"]

Eye-catching Title

Header Image

Introduction

Engaging opening paragraph...

Key Points

  1. First point with emphasis
  2. Second point with style

Quotable highlight text

Code Example

def example():
    print("Hello, readers!")

Summary

Key takeaways...

bloggingtemplatewritingdocumentation

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
Rendered output:

Basic Table

Header 1Header 2
Cell 1Cell 2

Table with Alignment

LeftCenterRight
LCR

Pro Tips

  • Use a Table Generator for complex tables
  • Align pipes for readability
  • Test in live preview before finalizing
tablesguidetipsbest-practices

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!");
}
```
Rendered output:

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
  1. First step
  2. Second step
  3. Final step

Quotes and Code

"Markdown makes writing for the web fast and easy."

function hello() {
  console.log("Hello, Markdown!");
}
formattingexamplesbasicscomprehensive

Comments

U
No comments yet. Be the first to comment!

Similar Markdown

See All

© 2025 Stack Online Tools. All rights reserved.