Markdown Syntax Guide

A comprehensive guide to Markdown formatting

What is Markdown?

Markdown is a lightweight markup language that lets you add formatting to plain text documents. Unlike rich text editors, Markdown uses simple symbols like asterisks and hashes that remain readable even when viewing the raw source.

Created by John Gruber and Aaron Swartz in 2004, Markdown was designed with one goal: to be as easy to read and write as possible. The syntax draws inspiration from the conventions people naturally use when writing plain text emails, making it intuitive for anyone to pick up.

Today, Markdown has become the standard for documentation, README files, note-taking apps, and content platforms like GitHub, Stack Overflow, and Reddit. Its simplicity and portability mean your content stays readable and editable anywhere, without being locked into proprietary formats.


Headers

# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6

Result:

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Text Formatting

**Bold text**
*Italic text*
***Bold and italic***
~~Strikethrough text~~
`Inline code`

Result:

Bold text

Italic text

Bold and italic

Strikethrough text

Inline code

Lists

Bullet Lists

- Item 1
- Item 2
  - Subitem
  - Another subitem
- Item 3

* You can also use asterisks
+ Or plus signs

Result:

  • Item 1
  • Item 2
    • Subitem
    • Another subitem
  • Item 3

Numbered Lists

1. First item
2. Second item
3. Third item
   1. Subitem
   2. Another subitem

Result:

  1. First item
  2. Second item
  3. Third item
    1. Subitem
    2. Another subitem

Links and Images

Links

[Link text](https://example.com)
[Link with title](https://example.com "Title on hover")
<https://example.com>

Images

![Alt text](image.jpg)
![Alt text](image.jpg "Title")

Result:

[Image: Alt text]

Tables

| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Row 1    | Data     | More data |
| Row 2    | Data     | More data |

| Left | Center | Right |
|:-----|:------:|------:|
| Text | Text   | Text  |

Result:

Column 1Column 2Column 3
Row 1DataMore data
Row 2DataMore data

Code Blocks

Inline Code

Use `backticks` for inline code.

Result:

Use backticks for inline code.

Fenced Code Blocks

```javascript
// Code block with syntax highlighting
function helloWorld() {
    console.log("Hello, World!");
}
```

```python
# Python example
def hello_world():
    print("Hello, World!")
```

Result:

// Code block with syntax highlighting
function helloWorld() {
    console.log("Hello, World!");
}

Blockquotes

> This is a quote
> 
> It can span multiple lines

> Quotes can also be
> > nested

Result:

This is a quote

It can span multiple lines
Quotes can also be
nested

Horizontal Rules

---
***
___

Result:


Checklists

- [x] Completed task
- [ ] Open task
- [x] Another completed task
  - [ ] Subtask
  - [x] Completed subtask

Result:

  • Completed task
  • Open task
  • Another completed task
    • Subtask
    • Completed subtask

Escaping Characters

Use backslash to escape special characters:
\* \_ \# \[ \] $$ $$ \` \~

Result:

Use backslash to escape special characters:
* _ # [ ] ( ) ` ~

Advanced Tips

Combining Formatting

**You can combine _different_ formatting~~types~~**

Result:

You can combine different formattingtypes

Line Breaks

Two spaces at the end of a line
create a line break.

An empty line creates a new paragraph.

Result:

Two spaces at the end of a line
create a line break.

An empty line creates a new paragraph.

HTML in Markdown

You can use <em>HTML tags</em> in Markdown.
<kbd>Ctrl</kbd>+<kbd>C</kbd> to copy.

Result:

You can use HTML tags in Markdown.

Ctrl+C to copy.

View Markdown Files Beautifully on macOS

Markdown Peek lets you instantly preview any Markdown file with GitHub-style formatting and Quick Look support.

Download on the App Store