Text Formatting
Emphasis
Bold text
1
| **Bold text** or __Bold text__
|
Italic text
1
| *Italic text* or _Italic text_
|
Bold and italic
1
| ***Bold and italic*** or **_Bold and italic_**
|
Strikethrough
Superscript and Subscript
E=mc2
H2O
Escape Characters
Use backslash to escape special characters: *literal asterisks*
ATX Style (Recommended)
1
2
3
4
5
6
| # H1 Header
## H2 Header
### H3 Header
#### H4 Header
##### H5 Header
###### H6 Header
|
Setext Style
1
2
3
4
5
| Header 1
========
Header 2
--------
|
Lists
Unordered Lists
- Item 1
- Item 2
- Nested item
- Another nested item
- Item 3
1
2
3
4
5
| * Item 1
* Item 2
* Nested item
* Another nested item
* Item 3
|
Ordered Lists
- First item
- Second item
- Nested item
- Another nested item
- Third item
1
2
3
4
5
| 1. First item
2. Second item
1. Nested item
2. Another nested item
3. Third item
|
Task Lists
- Completed task
- Incomplete task
- Another completed task
1
2
3
| - [x] Completed task
- [ ] Incomplete task
- [x] Another completed task
|
Links
Inline Links
This is a Google link.
1
| [Google](https://www.google.com "Google Homepage")
|
Reference Links
This is a reference link and another reference link.
1
2
3
4
5
| [reference link][1]
[reference link][google]
[1]: https://www.google.com "Google"
[google]: https://www.google.com
|
Automatic Links
https://www.google.com
Images
Inline Images
1
| 
|
Reference Images
1
2
3
| ![Google Logo][logo]
[logo]: https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
|
Code
Inline Code
Use backticks
for inline code.
1
| Use `backticks` for inline code.
|
Code Blocks
1
2
3
| ```
Plain code block
```
|
Syntax Highlighting
1
2
3
| function hello() {
console.log("Hello World!");
}
|
1
2
3
4
5
| ```javascript
function hello() {
console.log("Hello World!");
}
```
|
Indented Code Blocks
1
2
| This is an indented code block
using 4 spaces or 1 tab
|
1
2
| This is an indented code block
using 4 spaces or 1 tab
|
Line Numbers in Code Blocks
```javascript {linenos=true} function hello() { console.log(βHello World!β); return true; }
```javascript {linenos=true} function hello() { console.log(βHello World!β); return true; }
Tables
Left Aligned | Center Aligned | Right Aligned |
---|
Left | Center | Right |
Text | Text | Text |
1
2
3
4
| | Left Aligned | Center Aligned | Right Aligned |
|:-------------|:--------------:|--------------:|
| Left | Center | Right |
| Text | Text | Text |
|
Simple Table
Column 1 | Column 2 | Column 3 |
---|
Data 1 | Data 2 | Data 3 |
Data 4 | Data 5 | Data 6 |
1
2
3
4
| Column 1 | Column 2 | Column 3
---------|----------|----------
Data 1 | Data 2 | Data 3
Data 4 | Data 5 | Data 6
|
Blockquotes
This is a blockquote.
It can span multiple lines.
Nested blockquotes are also possible.
1
2
3
4
5
| > This is a blockquote.
>
> It can span multiple lines.
>
> > Nested blockquotes are also possible.
|
Horizontal Rules
Three or more dashes, asterisks, or underscores:
Line Breaks
End a line with two or more spaces for a line break.
First line
Second line
1
2
| First line
Second line
|
HTML Elements
Definition Lists
- Term 1
- Definition 1
- Term 2
- Definition 2
1
2
3
4
5
6
| <dl>
<dt>Term 1</dt>
<dd>Definition 1</dd>
<dt>Term 2</dt>
<dd>Definition 2</dd>
</dl>
|
Preformatted Text
Preformatted text
preserves spaces
and line breaks
1
2
3
4
5
| <pre>
Preformatted text
preserves spaces
and line breaks
</pre>
|
YouTube Videos (HTML)
1
2
3
| <a href="https://www.youtube.com/watch?v=BZhWUE1A198" target="_blank">
<img src="https://img.youtube.com/vi/BZhWUE1A198/0.jpg" alt="Video Thumbnail" width="240" height="180">
</a>
|
YouTube Videos (Markdown)

1
| [](https://www.youtube.com/watch?v=BZhWUE1A198)
|
Special Features
Emoji
π β€οΈ π π (Unicode) or :smile: :heart: :thumbsup: :octocat: (shortcodes)
1
2
| π β€οΈ π π (Unicode)
:smile: :heart: :thumbsup: :octocat: (shortcodes - requires jemoji plugin)
|
Emoji Cheatsheet
Highlighting
Highlighted text
1
| <mark>Highlighted text</mark>
|
Keyboard Keys
Press Ctrl + C to copy.
1
| Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.
|
Math Expressions
Inline Math
This is inline math: $E = mc^2$
Block Math
\[\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}\]
1
2
3
| $$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
|
Note: Requires MathJax or KaTeX support
This text has a footnote.
1
2
3
| This text has a footnote[^1].
[^1]: This is the footnote content.
|
1
| <!-- This is a comment that won't be visible -->
|
Collapsible Sections
Click to expand
This content is hidden by default and can be expanded by clicking the summary. - Item 1 - Item 2 - Item 3 1
2
3
4
5
6
| <details>
<summary>Click to expand</summary>
This content is hidden by default.
</details>
|
Anchor Links
Link to custom header
1
2
| ### Custom ID Headers {#custom-header}
[Link to custom header](#custom-header)
|
Best Practices
- Use consistent formatting throughout your document
- Add blank lines around headers and sections for readability
- Use descriptive alt text for images
- Include titles for links when helpful
- Test your markdown in your target renderer
- Use reference links for repeated URLs
- Indent nested lists properly with 2-4 spaces
- Use semantic headers (H1 for title, H2 for main sections)
- Keep line length reasonable (80-120 characters)
- Preview before publishing to catch formatting issues
Conclusion
This comprehensive markdown cheatsheet covers all essential syntax from basic text formatting to advanced features like math expressions and collapsible sections. Bookmark this reference for quick lookup while writing documentation, README files, or blog posts. Remember to test your markdown in your target environment since different renderers may have slight variations in support.