Markdown Syntax Guide
Markdown is a lightweight markup language for creating formatted text using a plain-text editor.
Headings
Use #
for headings. Add more #
for smaller headings.
# H1
## H2
### H3
#### H4
##### H5
###### H6
Output:
H1
H2
H3
H4
H5
H6
Emphasis
- Bold: Use
**text**
or__text__
. - Italic: Use
*text*
or_text_
. Strikethrough:Use~~text~~
.
**Bold**
*Italic*
~~Strikethrough~~
Output:
Bold
Italic
Strikethrough
Lists
Unordered List
Use -
, *
, or +
.
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
Ordered List
Use numbers followed by a period.
1. First item
2. Second item
1. Subitem 2.1
2. Subitem 2.2
Links
Create hyperlinks using [link text](URL)
.
[OpenAI](https://www.openai.com)
Output:
Images
Embed images using ![alt text](URL)
.
![OpenAI Logo](https://via.placeholder.com/150)
Code
Inline Code
Wrap code with backticks: `code`
.
Block Code
Use triple backticks for code blocks:
\`\`\`language
Code block
\`\`\`
Example:
def hello_world():
print("Hello, world!")
Blockquotes
Use >
to create blockquotes.
> This is a blockquote.
>> Nested blockquote.
Output:
This is a blockquote.
Nested blockquote.
Horizontal Rules
Use ---
, ***
, or ___
.
---
Tables
Create tables with |
and -
.
| Header 1 | Header 2 |
|----------|----------|
| Row 1 | Data |
| Row 2 | More Data|
Output:
| Header 1 | Header 2 | |———-|———-| | Row 1 | Data | | Row 2 | More Data|
Task Lists
Use - [ ]
for unchecked and - [x]
for checked.
- [ ] Task 1
- [x] Task 2
Output:
- Task 1
- Task 2
Escaping Characters
Use a backslash \
to escape Markdown syntax.
\*This text is not italicized.*
Inline HTML
You can include raw HTML for advanced formatting.
<p>This is a paragraph in HTML.</p>
Footnotes
Use [^1]
for footnotes.
This is a sentence with a footnote.[^1]
[^1]: This is the footnote content.
Definition Lists
Term
: Definition
Additional Notes
Markdown files typically have the .md
or .markdown
extension.