Skip to content

HOW-TO Write Markdown (Cheatsheet)

Use ”#” to create headers of different levels:

# Header 1
## Header 2
### Header 3
plaintext

Renders as

Emphasize text using asterisks (*) or underscores (_):

  • Italic: *Italic* or _Italic_
  • Bold: **Bold** or __Bold__
  • Bold and Italic: ***Bold and Italic***

Create unordered lists with asterisks (*), plus (+), or minus (-):

* Item 1
* Item 2
* Subitem 2.1
* Subitem 2.2
plaintext

Renders as

  • Item 1
  • Item 2
    • Subitem 2.1
    • Subitem 2.2

Create ordered lists with numbers:

1. Item 1
2. Item 2
1. Subitem 2.1
2. Subitem 2.2
plaintext

Renders as

  1. Item 1
  2. Item 2
    1. Subitem 2.1
    2. Subitem 2.2

Create hyperlinks with [text](URL):

[OpenAI](https://www.openai.com)
plaintext

Renders as
OpenAI

Embed images with ![alt text](image URL):

![Markdown Logo](https://markdown-here.com/img/icon256.png)
plaintext

Renders as
Markdown Logo

Quote text with a greater-than sign (>):

> This is a blockquote.
plaintext

Renders as

This is a blockquote.

Inline code with backticks (`):

Use `inline code` within your text.
plaintext

Renders as
Use inline code within your text.

Create code blocks by indenting with four spaces or using triple backticks (```):

``` 
def greet(name):
    print(f"Hello, {name}!")
``` 

Renders as

def greet(name):
print(f"Hello, {name}!")
plaintext

Create a horizontal rule with three or more hyphens, asterisks, or underscores:

---
plaintext

Create tables using pipes (|) and hyphens (-) for headers:

| Header 1 | Header 2 |
| -------- | -------- |
| Data 1 | Data 2 |
| Data 3 | Data 4 |
plaintext

Renders as

Header 1Header 2
Data 1Data 2
Data 3Data 4

To display characters that have special Markdown meanings, use a backslash () before them:

\*This won't be italic\*
plaintext

Renders as
*This won’t be italic*

Force a line break with two spaces at the end of a line:

This is the first line.
This is the second line.
plaintext

Renders as
This is the first line.
This is the second line.

Markdown doesn’t have a native comment syntax, but you can use HTML comments:

<!-- This is a comment -->
html

Renders as

(you see nothing)

This Markdown cheatsheet covers some of the most commonly used formatting elements. Markdown is versatile and can be extended with additional features depending on the platform you’re using.