Markdown Syntax Guide – Complete Reference with Examples (2026)

Published · Updated

Markdown syntax is the foundation of modern documentation, blogging, and technical writing. This guide covers every Markdown syntax element you need, from basic formatting to advanced GitHub Flavored Markdown (GFM) features. Use our free Markdown live preview tool to test each element as you learn.

For quick answers, Markdown uses > for a quote or blockquote, [text](url) for a link, and --- for a horizontal line. The examples below show the exact syntax and rendered result so you can copy the format into a README, documentation page, or AI prompt.

Headings

Headings are created using hash symbols. The number of hashes determines the heading level:

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

Result:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Text Formatting

Markdown supports several ways to format text:

**Bold text** or __Bold text__
*Italic text* or _Italic text_
***Bold and italic***
~~Strikethrough~~
`Inline code`

Result:

Bold text or Bold text Italic text or Italic text Bold and italic Strikethrough Inline code


Lists

Unordered Lists

Use hyphens, asterisks, or plus signs:

- Item 1
- Item 2
  - Nested item
- Item 3

Ordered Lists

Use numbers followed by periods:

1. First item
2. Second item
3. Third item

Task Lists

GFM task lists use brackets:

- [x] Completed task
- [ ] Incomplete task
- [ ] Another task

Result:

  • Completed task
  • Incomplete task
  • Another task

Markdown Link Syntax

Markdown link syntax uses square brackets for the visible link text and parentheses for the destination URL:

[Link text](https://example.com)
[Link with title](https://example.com "Title text")
[Reference link][1]

[1]: https://example.com

Use inline links for one-off references and reference-style links when the same destination appears several times. Add an optional title after the URL when you want a tooltip in supported Markdown renderers.


Images

![Alt text](image-url.jpg)
![Alt text](image-url.jpg "Optional title")

Markdown Quote and Blockquote Syntax

Use the greater-than sign (>) at the start of a line to create a Markdown quote or blockquote. Add another > to nest a quote inside an existing quote.

> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes are also supported.

Result:

This is a blockquote. It can span multiple lines.

Nested blockquotes are also supported.

This Markdown blockquote syntax is supported by GitHub and most Markdown renderers. Add a blank > line to separate paragraphs inside the same quote.


Code Blocks

Fenced Code Blocks

Use triple backticks with an optional language identifier:

```javascript
function greet(name) {
  return `Hello, ${name}!`;
}
```

Indented Code Blocks

Indent content with four spaces:

    This is a code block
    created with indentation.

Tables

Tables use pipes and hyphens:

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

Result:

Header 1Header 2Header 3
Cell 1Cell 2Cell 3
Cell 4Cell 5Cell 6

Table Alignment

| Left-aligned | Center-aligned | Right-aligned |
|:-------------|:--------------:|--------------:|
| Left         |     Center     |         Right |

Markdown Horizontal Line Syntax

Create a Markdown horizontal line, also called a horizontal rule or divider, using three or more hyphens, asterisks, or underscores:

---
***
___

The three forms render as a horizontal divider. Use --- when you want the clearest, most portable Markdown syntax; make sure it is separated from surrounding paragraphs by blank lines.


Line Breaks

End a line with two spaces for a line break, or leave a blank line for a new paragraph.


HTML in Markdown

You can use inline HTML in Markdown:

This is <strong>bold</strong> using HTML.
This is <em>italic</em> using HTML.

Escape Characters

Use backslashes to display literal characters:

\*Not italic\*
\#Not a heading

Advanced GFM Features

Autolinks

GFM automatically converts URLs to links:

https://markdowntoolsonline.com

Emoji Shortcodes

:smile: :rocket: :thumbsup:

Alerts

> [!NOTE]
> This is a note alert.

> [!WARNING]
> This is a warning alert.

Try Markdown Syntax Live

Practice all these Markdown syntax elements in our free online Markdown preview editor. Type or paste any Markdown syntax and see the rendered result instantly with real-time preview. You can also build tables with the Markdown table generator or compare two drafts with the Markdown diff checker.

Related Resources

Frequently Asked Questions