HOW-TO Write Markdown (Cheatsheet)
HOW-TO Write Markdown (Cheatsheet)
Section titled “HOW-TO Write Markdown (Cheatsheet)”Headers
Section titled “Headers”Use ”#” to create headers of different levels:
# Header 1## Header 2### Header 3Renders as
Header 1
Section titled “Header 1”Header 2
Section titled “Header 2”Header 3
Section titled “Header 3”Emphasis
Section titled “Emphasis”Emphasize text using asterisks (*) or underscores (_):
- Italic:
*Italic*or_Italic_ - Bold:
**Bold**or__Bold__ - Bold and Italic:
***Bold and Italic***
Unordered Lists
Section titled “Unordered Lists”Create unordered lists with asterisks (*), plus (+), or minus (-):
* Item 1* Item 2 * Subitem 2.1 * Subitem 2.2Renders as
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
Ordered Lists
Section titled “Ordered Lists”Create ordered lists with numbers:
1. Item 12. Item 2 1. Subitem 2.1 2. Subitem 2.2Renders as
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
Create hyperlinks with [text](URL):
[OpenAI](https://www.openai.com)Renders as
OpenAI ↗
Images
Section titled “Images”Embed images with :
Renders as
![]()
Blockquotes
Section titled “Blockquotes”Quote text with a greater-than sign (>):
> This is a blockquote.Renders as
This is a blockquote.
Inline code with backticks (`):
Use `inline code` within your text.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}!")Horizontal Rule
Section titled “Horizontal Rule”Create a horizontal rule with three or more hyphens, asterisks, or underscores:
---Renders as
Section titled “Renders as”Tables
Section titled “Tables”Create tables using pipes (|) and hyphens (-) for headers:
| Header 1 | Header 2 || -------- | -------- || Data 1 | Data 2 || Data 3 | Data 4 |Renders as
| Header 1 | Header 2 |
|---|---|
| Data 1 | Data 2 |
| Data 3 | Data 4 |
Escaping Characters
Section titled “Escaping Characters”To display characters that have special Markdown meanings, use a backslash () before them:
\*This won't be italic\*Renders as
*This won’t be italic*
Line Breaks
Section titled “Line Breaks”Force a line break with two spaces at the end of a line:
This is the first line.This is the second line.Renders as
This is the first line.
This is the second line.
Comments
Section titled “Comments”Markdown doesn’t have a native comment syntax, but you can use HTML comments:
<!-- This is a comment -->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.