Table of Contents
Basic Markdown Syntax
Master the essential Markdown elements that work in all applications. These are the building blocks of Markdown formatting.
Jump to Section
Headers
Create headings using hash symbols (#). The number of hashes determines the heading level.
Basic Headers
# H1 Heading
## H2 Heading
### H3 Heading
#### H4 Heading
##### H5 Heading
###### H6 Heading
H1 Heading
H2 Heading
H3 Heading
H4 Heading
H5 Heading
H6 Heading
Use one to six # symbols for different heading levels. Always add a space after the #.
Alternative Syntax
H1 Alternative
===============
H2 Alternative
---------------
H1 Alternative
H2 Alternative
You can also use = for H1 and - for H2 headers. This syntax only works for H1 and H2.
Tips & Best Practices
- Always put a space between the # and the header text
- Try to skip heading levels (don't go from H1 to H3)
- Use only one H1 per document for better SEO
- Keep headers descriptive and concise
Paragraphs
Create paragraphs by separating text with blank lines.
Basic Paragraphs
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.
Use a blank line to separate paragraphs. Don't indent paragraphs with spaces or tabs.
Tips & Best Practices
- Don't indent paragraphs with spaces or tabs
- Use blank lines to separate paragraphs
- Keep paragraphs focused on a single idea
Line Breaks
Create line breaks within paragraphs using two or more spaces at the end of a line.
Hard Line Breaks
This is the first line.
This is the second line.
This is another paragraph.
With a line break.
This is the first line.
This is the second line.
This is another paragraph.
With a line break.
Add two or more spaces at the end of a line, then press Enter to create a line break.
HTML Alternative
This is the first line.<br>
This is the second line.
This is the first line.<br> This is the second line.
You can also use HTML <br> tags for line breaks.
Tips & Best Practices
- Use two or more spaces at the end of a line for line breaks
- Consider using HTML <br> tags for better visibility
- Use line breaks sparingly for better readability
Bold & Italic
Emphasize text using asterisks (*) or underscores (_).
Bold Text
**This text is bold**
__This is also bold__
This text is bold This is also bold
Use two asterisks or underscores around text to make it bold.
Italic Text
*This text is italic*
_This is also italic_
This text is italic This is also italic
Use single asterisks or underscores around text to make it italic.
Bold and Italic
***This text is bold and italic***
___This is also bold and italic___
**_Mix and match_**
*__Also works__*
This text is bold and italic This is also bold and italic Mix and match Also works
Combine bold and italic by using three asterisks/underscores or mixing them.
Tips & Best Practices
- Asterisks are generally preferred over underscores
- Be consistent with your choice throughout the document
- Use emphasis sparingly for maximum impact
Blockquotes
Create blockquotes using the greater than symbol (>).
Basic Blockquote
> This is a blockquote.
> It can span multiple lines.
This is a blockquote. It can span multiple lines.
Use > at the beginning of each line for blockquotes.
Nested Blockquotes
> This is a blockquote.
>
>> This is a nested blockquote.
>
> Back to the first level.
This is a blockquote.
This is a nested blockquote.
Back to the first level.
Use >> for nested blockquotes. Add blank lines for better separation.
Blockquotes with Other Elements
> ## This is a header in a blockquote
>
> This is a paragraph in a blockquote.
>
> - This is a list item
> - This is another list item
This is a header in a blockquote
This is a paragraph in a blockquote.
- This is a list item
- This is another list item
You can include other Markdown elements inside blockquotes.
Tips & Best Practices
- Use blockquotes for quotes, notes, or warnings
- Add blank lines around blockquotes for better readability
- You can nest blockquotes for different levels of emphasis
Lists
Create ordered and unordered lists using numbers or symbols.
Unordered Lists
- First item
- Second item
- Third item
* First item
* Second item
* Third item
+ First item
+ Second item
+ Third item
- First item
- Second item
- Third item
- First item
- Second item
- Third item
- First item
- Second item
- Third item
Use -, *, or + for unordered lists. Be consistent within each list.
Ordered Lists
1. First item
2. Second item
3. Third item
1. First item
8. Second item (number doesn't matter)
3. Third item
-
First item
-
Second item
-
Third item
-
First item
-
Second item (number doesn't matter)
-
Third item
Use numbers followed by periods. The actual numbers don't need to be in order.
Nested Lists
1. First item
- Nested item
- Another nested item
2. Second item
1. Ordered nested item
2. Another ordered nested item
- First item
- Nested item
- Another nested item
- Second item
- Ordered nested item
- Another ordered nested item
Indent nested list items with 2-4 spaces or one tab.
Lists with Multiple Paragraphs
1. First item
This is a paragraph under the first item.
2. Second item
This is a paragraph under the second item.
- Nested list item
- Another nested list item
-
First item
This is a paragraph under the first item.
-
Second item
This is a paragraph under the second item.
- Nested list item
- Another nested list item
Indent paragraphs under list items to keep them part of the list.
Tips & Best Practices
- Use consistent indentation (2-4 spaces) for nested lists
- Add blank lines around lists for better readability
- You can mix ordered and unordered lists in nesting
Code
Display code using backticks (`) for inline code or triple backticks for code blocks.
Inline Code
Use `console.log()` to print to the console.
The `git status` command shows the status of your repository.
Use console.log()
to print to the console.
The git status
command shows the status of your repository.
Use single backticks around inline code. The code will be highlighted differently from regular text.
Code Blocks
```
function greet(name) {
return "Hello, " + name + "!";
}
```
function greet(name) {
return "Hello, " + name + "!";
}
Use triple backticks for code blocks. The code will be displayed in a separate block.
Code Blocks with Language
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet("World"));
```
```python
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
```
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet("World"));
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
Specify the language after the opening backticks for syntax highlighting.
Tips & Best Practices
- Use inline code for short code snippets within text
- Use code blocks for longer code examples
- Specify the language for better syntax highlighting
- Escape backticks in code using double backticks
Horizontal Rules
Create horizontal dividing lines using three or more hyphens, asterisks, or underscores.
Different Styles
---
***
___
- - -
* * *
_ _ _
All of these create horizontal rules. Choose one style and be consistent.
Tips & Best Practices
- Use horizontal rules to separate content sections
- Add blank lines before and after horizontal rules
- Choose one style and stick with it throughout your document
Links
Create clickable links using brackets and parentheses.
Inline Links
[Markdown Guide](https://www.markdownguide.org)
[Markdown Guide with Title](https://www.markdownguide.org "The best Markdown guide")
Use [text](URL) for inline links. Add titles with quotes after the URL.
Reference Links
[Markdown Guide][1]
[Google][google]
[1]: https://www.markdownguide.org
[google]: https://www.google.com "Google Homepage"
Reference links separate the link text from the URL for cleaner text.
Automatic Links
<https://www.markdownguide.org>
<[email protected]>
Use angle brackets for automatic links to URLs and email addresses.
Tips & Best Practices
- Use descriptive link text instead of "click here"
- Test your links to make sure they work
- Use reference links for cleaner document formatting
- Consider adding titles for additional context
Images
Embed images using an exclamation mark followed by brackets and parentheses.
Basic Images


Use  for images. Alt text is important for accessibility.
Reference Images
![Markdown Logo][logo]
[logo]: https://markdown-here.com/img/icon256.png "Markdown Logo"
Reference images work like reference links for cleaner text.
Tips & Best Practices
- Always include descriptive alt text for accessibility
- Use relative paths for local images
- Consider image file sizes for web performance
- Test image links to ensure they display correctly