← Back to Converter

Markdown Syntax Reference

Complete guide to every Markdown element with examples and edge cases

Quick Reference

This reference covers CommonMark syntax and GitHub Flavored Markdown (GFM) extensions. Elements marked with "GFM" require GitHub Flavored Markdown support.

Standards Covered:
  • CommonMark 0.30 (2021)
  • GitHub Flavored Markdown (2017)
Compatibility:
  • GitHub, GitLab, Discord, Slack
  • Most modern Markdown parsers

Headers

H1-H6 Headers

Create hierarchical headers using 1-6 hash symbols

Syntax:

# H1
## H2
### H3
#### H4
##### H5
###### H6

Rendered Output:

H1


H2


H3


H4


H5

H6

Note: Always use a space after the hash. Avoid skipping header levels.

Alternative H1/H2

Alternative syntax for H1 and H2 using underlines

Syntax:

Header 1
========

Header 2
--------

Rendered Output:

Header 1
========

Header 2
--------

Note: Underline must be at least as long as the header text

Text Formatting

Bold Text

Make text bold using double asterisks or underscores

Syntax:

**bold text** or __bold text__

Rendered Output:

bold text or __bold text__

Note: Asterisks are more common and work in more contexts

Italic Text

Make text italic using single asterisks or underscores

Syntax:

*italic text* or _italic text_

Rendered Output:

italic text or _italic text_

Note: Use underscores when asterisks appear in the text

Bold and Italic

Combine bold and italic formatting

Syntax:

***bold and italic*** or ___bold and italic___

Rendered Output:

bold and italic or ___bold and italic___

Note: Can also use **_text_** or __*text*__

Strikethrough

Cross out text (GitHub Flavored Markdown)

Syntax:

~~strikethrough text~~

Rendered Output:

strikethrough text

Note: Not supported in all Markdown parsers

Inline Code

Format code or technical terms inline

Syntax:

`inline code`

Rendered Output:

inline code

Note: Use double backticks for code containing backticks: ``code with `backticks` ``

Lists

Unordered Lists

Create bullet lists using -, *, or +

Syntax:

- Item 1
- Item 2
  - Nested item
  - Another nested item
- Item 3

Rendered Output:

- Item 1
- Item 2
- Nested item
- Another nested item
- Item 3

Note: Use consistent markers. Indent nested items with 2 spaces

Ordered Lists

Create numbered lists using numbers and periods

Syntax:

1. First item
2. Second item
   1. Nested item
   2. Another nested
3. Third item

Rendered Output:

1. First item
2. Second item
1. Nested item
2. Another nested
3. Third item

Note: Numbers don't need to be sequential. Use 3 spaces for nesting

Task Lists

Create checkboxes (GitHub Flavored Markdown)

Syntax:

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

Rendered Output:

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

Note: Use [x] for checked, [ ] for unchecked

Code Blocks

Fenced Code Blocks

Create code blocks with syntax highlighting

Syntax:

```javascript
function hello() {
  console.log('Hello!');
}
```

Rendered Output:

function hello() {
console.log('Hello!');
}

Note: Specify language for proper highlighting

Indented Code Blocks

Create code blocks using 4-space indentation

Syntax:

    function hello() {
        console.log('Hello!');
    }

Rendered Output:

function hello() {
console.log('Hello!');
}

Note: No syntax highlighting with this method

Blockquotes

Simple Blockquotes

Create quoted text using >

Syntax:

> This is a blockquote
> spanning multiple lines

Rendered Output:

> This is a blockquote
> spanning multiple lines

Note: Add > to each line or use lazy continuation

Nested Blockquotes

Create nested quotes using multiple >

Syntax:

> Outer quote
> > Nested quote
> Back to outer quote

Rendered Output:

> Outer quote
> > Nested quote
> Back to outer quote

Note: Useful for email-style quote threading

Tables (GFM)

Basic Tables

Create tables using pipes and dashes

Syntax:

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

Rendered Output:

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

Note: Outer pipes are optional. Use at least 3 dashes for separators

Aligned Tables

Align columns using colons in separator row

Syntax:

| Left | Center | Right |
|:-----|:------:|------:|
| L1   |   C1   |    R1 |
| L2   |   C2   |    R2 |

Rendered Output:

| Left | Center | Right |
|:-----|:------:|------:|
| L1 | C1 | R1 |
| L2 | C2 | R2 |

Note: :--- (left), :---: (center), ---: (right)

Horizontal Rules

Horizontal Rules

Create horizontal dividers

Syntax:

---
or
***
or
___

Rendered Output:

---
or
***
or
___

Note: Use at least 3 characters. Can have spaces between

Escaping

Escape Characters

Escape special characters with backslashes

Syntax:

\* Not italic \*
\# Not a header

Rendered Output:

\ Not italic \
\# Not a header

Note: Use \ before: \ ` * _ { } [ ] ( ) # + - . !

Common Mistakes and Solutions

❌ Common Mistakes

  • Missing spaces: Using #Header instead of # Header
  • Inconsistent indentation: Mixing tabs and spaces in lists
  • Incorrect nesting: Using wrong number of spaces for nested items
  • Unescaped characters: Using * or _ without escaping when not formatting
  • Missing blank lines: Not separating elements with blank lines

✅ Best Practices

  • Consistent spacing: Always use spaces after # for headers
  • Proper nesting: Use 2 spaces for unordered lists, 3 for ordered
  • Blank line separation: Add blank lines around headers, lists, and code blocks
  • Meaningful alt text: Always include descriptive alt text for images
  • Language specification: Always specify language for code blocks

Feature Compatibility

FeatureCommonMarkGitHubDiscordSlackReddit
Headers
Bold/Italic
Strikethrough
Tables
Task Lists
Math

Related Resources

Practice Your Markdown Skills

Use our free online converter to practice Markdown syntax with real-time preview.

Try the Converter