Markdown Basic Syntax
Markdown's basic syntax is simple and easy to learn. This chapter introduces the most commonly used core syntax, allowing you to quickly master the basics of Markdown.
Paragraphs and Line Breaks
Paragraphs
Separate paragraphs with blank lines:
This is the first paragraph.
This is the second paragraph.Result:
This is the first paragraph.
This is the second paragraph.
Line Breaks
Add two spaces at the end of a line or use the <br> tag:
First line
Second lineResult:
First line Second line
Headings
Use # symbols to create headings, supporting levels 1-6:
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 HeadingResult:
Level 1 Heading
Level 2 Heading
Level 3 Heading
Level 4 Heading
Level 5 Heading
Level 6 Heading
Text Styling
Bold
Use ** or __ to surround text:
**This is bold text**
__This is also bold text__Result: This is bold text
Italic
Use * or _ to surround text:
*This is italic text*
_This is also italic text_Result: This is italic text
Bold and Italic
Use *** or ___ to surround text:
***This is bold and italic text***
___This is also bold and italic text___Result: This is bold and italic text
Strikethrough
Use ~~ to surround text:
~~This is strikethrough text~~Result: This is strikethrough text
Lists
Unordered Lists
Use -, +, or * to create:
- Item one
- Item two
- Item threeResult:
- Item one
- Item two
- Item three
Ordered Lists
Use numbers followed by . to create:
1. First item
2. Second item
3. Third itemResult:
- First item
- Second item
- Third item
Nested Lists
Use indentation to create nesting:
- Main item
- Sub-item 1
- Sub-item 2
- Sub-sub-itemResult:
- Main item
- Sub-item 1
- Sub-item 2
- Sub-sub-item
Links
Inline Links
[Link text](https://example.com)
[Link with title](https://example.com "Title shown on hover")Result: Link text
Reference Links
[Link text][ref]
[ref]: https://example.com "Optional title"Automatic Links
<https://example.com>
<email@example.com>Result: https://example.com
Images
Basic Syntax

Reference-style Images
![Alt text][img-ref]
[img-ref]: Image URL "Optional title"Blockquotes
Use > to create blockquotes:
> This is a blockquote.
> It can have multiple lines.Result:
This is a blockquote. It can have multiple lines.
Nested Blockquotes
> First level quote
>> Second level quote
>>> Third level quoteResult:
First level quote
Second level quote
Third level quote
Code
Inline Code
Use backticks ` to surround:
This is an `inline code` example.Result: This is an inline code example.
Code Blocks
Use three backticks ``` to create:
This is a code block Can have multiple lines
Code Blocks with Syntax Highlighting
```python
def hello():
print("Hello, World!")
**Result:**
```python
def hello():
print("Hello, World!")Horizontal Rules
Use three or more -, *, or _:
---
***
___Result:
Tables
Use | and - to create tables:
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Content 1 | Content 2 | Content 3 |
| Content 4 | Content 5 | Content 6 |Result:
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| Content 1 | Content 2 | Content 3 |
| Content 4 | Content 5 | Content 6 |
Alignment
| Left-aligned | Center-aligned | Right-aligned |
|:------------|:--------------:|--------------:|
| Left | Center | Right |Result:
| Left-aligned | Center-aligned | Right-aligned |
|---|---|---|
| Left | Center | Right |
Escaping Characters
Use backslash \ to escape special characters:
\* This is not italic \*
\# This is not a headingResult: * This is not italic *
Characters That Need Escaping
\ Backslash
` Backtick
* Asterisk
_ Underscore
{} Curly braces
[] Square brackets
() Parentheses
# Hash mark
+ Plus sign
- Hyphen
. Period
! Exclamation markTask Lists
Use - [ ] and - [x] to create:
- [x] Completed task
- [ ] Incomplete task
- [ ] Another taskResult:
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task
Footnotes
This is some text[^1].
[^1]: This is the footnote content.HTML Tags
Markdown supports inline HTML:
<div style="color: red;">
This is red text
</div>
<kbd>Ctrl</kbd> + <kbd>C</kbd>Result:
Ctrl + C
Common HTML Tags
Text Color
<span style="color: red;">Red text</span>
<span style="color: blue;">Blue text</span>Text Alignment
<center>Centered text</center>
<div align="right">Right-aligned text</div>Superscript and Subscript
H<sub>2</sub>O
X<sup>2</sup>Result: H2O, X2
Comments
Comments in Markdown are not displayed:
<!-- This is a comment and will not be shown on the page -->Quick Reference Table
| Element | Syntax |
|---|---|
| Headings | # H1 ## H2 ### H3 |
| Bold | **bold** |
| Italic | *italic* |
| Blockquote | > quote |
| Ordered List | 1. item |
| Unordered List | - item |
| Code | `code` |
| Horizontal Rule | --- |
| Link | [text](URL) |
| Image |  |
Practice Exercise
Try creating a document with the following elements:
- A level 1 heading
- An introduction paragraph (including bold and italic)
- An unordered list
- An ordered list
- A blockquote
- A code block
- A link
- A table
Summary
This chapter introduced Markdown's basic syntax, including:
- Headings and paragraphs
- Text formatting (bold, italic, strikethrough)
- Lists (ordered, unordered, nested)
- Links and images
- Blockquotes and code
- Tables and horizontal rules
After mastering these basic syntax elements, you can start using Markdown for daily writing. Next, we will dive deeper into each syntax's detailed usage.
Next: Learn more about Markdown Headings.