XXAIX

Markdown Formatting Guide

Markdown is a lightweight markup language that allows you to format plain text using simple syntax. It's widely used for documentation, README files, comments, and more.

Quick Reference

# Heading 1 Largest heading
## Heading 2 Second-level heading
**bold text** Bold text
*italic text* Italic text
[link text](url) Hyperlink
![alt text](image.jpg) Image
`code` Inline code
- item Unordered list
1. item Ordered list
> quote Blockquote

Headings

Use hashtags (#) to create headings. More hashtags = smaller heading.

Markdown

# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6

Output

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Emphasis (Bold & Italic)

Use asterisks (*) or underscores (_) for emphasis.

Markdown

*italic text* or _italic text_ **bold text** or __bold text__ ***bold and italic*** or ___bold and italic___ ~~strikethrough~~

Output

italic text or italic text

bold text or bold text

bold and italic or bold and italic

strikethrough

Lists

Create ordered or unordered lists.

Markdown

Unordered list: - Item 1 - Item 2 - Nested item 2.1 - Nested item 2.2 - Item 3 Ordered list: 1. First item 2. Second item 3. Third item 1. Nested item 3.1 2. Nested item 3.2

Output

Unordered list:

  • Item 1
  • Item 2
    • Nested item 2.1
    • Nested item 2.2
  • Item 3

Ordered list:

  1. First item
  2. Second item
  3. Third item
    1. Nested item 3.1
    2. Nested item 3.2

Links

Create hyperlinks to other pages or websites.

Markdown

[Link text](https://example.com) [Link with title](https://example.com "Hover text") <https://example.com> [Reference-style link][reference] [reference]: https://example.com

Images

Embed images using similar syntax to links, with a leading exclamation mark.

Markdown

![Alt text](image.jpg) ![Alt text with title](image.jpg "Image title") [![Linked image](image.jpg)](https://example.com)

Output

Image syntax: The image would appear here

Format: ![description](url)

The alt text is shown if the image can't load

Code

Display code inline or in blocks.

Markdown

Inline `code` has backticks ``` Code block with multiple lines ``` ```python # Code block with syntax highlighting def hello(): print("Hello, World!") ```

Output

Inline code has backticks

Code block with
multiple lines
# Code block with syntax highlighting
def hello():
    print("Hello, World!")

Blockquotes

Use greater-than symbol (>) to create blockquotes.

Markdown

> This is a blockquote > It can span multiple lines > Nested blockquotes >> Use multiple > symbols

Output

This is a blockquote
It can span multiple lines
Nested blockquotes
Use multiple > symbols

Horizontal Rules

Create horizontal lines to separate content.

Markdown

--- *** ___ (All three create horizontal rules)

Output


A horizontal line appears above

Tables

Create tables using pipes (|) and hyphens (-).

Markdown

| Header 1 | Header 2 | Header 3 | |----------|----------|----------| | Row 1 | Data | Data | | Row 2 | Data | Data | Alignment: | Left | Center | Right | |:-----|:------:|------:| | Text | Text | Text |

Output

Header 1 Header 2 Header 3
Row 1 Data Data
Row 2 Data Data

Task Lists

Create checkable task lists (GitHub-flavored Markdown).

Markdown

- [x] Completed task - [ ] Uncompleted task - [ ] Another task - [x] Nested completed - [ ] Nested uncompleted

Output

  • ☑ Completed task
  • ☐ Uncompleted task
  • ☐ Another task
    • ☑ Nested completed
    • ☐ Nested uncompleted

Escaping Characters

Use backslash (\) to display literal Markdown characters.

Markdown

\*Not italic\* \# Not a heading \[Not a link\](url)

Output

*Not italic*

# Not a heading

[Not a link](url)

Characters you can escape: \ ` * _ { } [ ] ( ) # + - . ! |

Best Practices

Common Use Cases

Discussion

Sign in to join the discussion.