Skip to content

Markdown Syntax Guide: From Basics to Advanced

Markdown is a lightweight markup language created by John Gruber in 2004. It lets you write formatted text using plain text syntax that is easy to read and write. Markdown is used everywhere: GitHub READMEs, documentation sites, blog platforms, note-taking apps, and messaging tools like Slack and Discord.

Headings

Use # symbols to create headings. One # is an h1, two is an h2, and so on up to six levels:

# Heading 1

## Heading 2

### Heading 3

#### Heading 4

Text Formatting

SyntaxResult
**bold**bold
*italic*italic
~~strikethrough~~strikethrough
`inline code`inline code
***bold and italic***bold and italic

Lists

Unordered lists use -, *, or + as bullet markers. Ordered lists use numbers followed by a period. Indent with two or four spaces for nested lists:

- Item one

- Item two

- Nested item

1. First

2. Second

3. Third

Links and Images

[Link text](https://example.com)

![Alt text](image.png)

[Link with title](https://example.com "Title")

Code Blocks

Wrap code in triple backticks for fenced code blocks. Add a language identifier after the opening backticks for syntax highlighting:

```javascript

const greeting = "Hello, world!";

console.log(greeting);

```

Tables

Create tables using pipes and hyphens. Use colons for alignment:

| Left | Center | Right |

|:-----|:------:|------:|

| a | b | c |

| d | e | f |

Blockquotes

Use > for blockquotes. Nest them by adding more > symbols:

> This is a blockquote

>

> > This is nested

Task Lists

GitHub Flavored Markdown (GFM) adds task list support with checkboxes:

- [x] Completed task

- [ ] Pending task

- [ ] Another pending task

Where Markdown is Used

  • GitHub. README files, issues, pull requests, comments, and wikis all use GFM.
  • Documentation. Tools like Docusaurus, MkDocs, and VitePress use Markdown files as the source of truth.
  • Blogs. Static site generators like Hugo, Jekyll, and Astro build pages from Markdown.
  • Note-taking. Obsidian, Notion, and Bear all support Markdown syntax.
  • Messaging. Slack, Discord, and Teams support a subset of Markdown formatting.

Preview your Markdown

Write Markdown and see the rendered output in real-time with our live previewer.

Open Markdown Previewer