Markdown Syntax Reference

Markdown formatting syntax for headers, lists, links, and more.

A one-page cheat sheet for Markdown, the plain-text way of formatting that's used in README files, GitHub and GitLab, Reddit, Discord, Slack, note apps such as Obsidian and many website editors. Each row shows what you type and what you get: hash signs for headings (# for the biggest, ###### for the smallest), asterisks or underscores for bold and italic, square brackets and parentheses for links and images, hyphens or numbers for lists, a greater-than sign for quotes, backticks for code, and three hyphens for a horizontal line. Rows marked GFM are GitHub Flavored Markdown extras: strikethrough with two tildes, task lists with checkboxes, and tables made with pipes and hyphens. Fenced code blocks, made with three backticks and an optional language name, are supported almost everywhere. Markdown was created by John Gruber in 2004 to be easy to read even before it's formatted. Because each app adds its own extensions, a few things (such as tables, task lists and how a single line break behaves) vary between apps. To see how your Markdown will look, paste it into the Markdown Preview.

Markdown syntax

You typeYou get
# Heading 1 … ###### Heading 6Headings, level 1 to 6
**bold** or __bold__Bold text
*italic* or _italic_Italic text
~~strikethrough~~Strikethrough (GitHub Flavored Markdown)
[link text](https://example.com)A link
![alt text](image.png)An image
- item or * itemA bulleted list
1. itemA numbered list
- [ ] task / - [x] doneA task list (GFM)
> quoteA block quote
`code`Inline code
```js … ```A fenced code block with syntax highlighting
---A horizontal rule
| a | b |\n|---|---|A table (GFM)
Two spaces at line end, or a blank lineA line break / a new paragraph
\*A literal asterisk (escape)

Common use cases

  • Format a README, wiki page or GitHub issue
  • Write notes in a Markdown app
  • Format messages in apps that support Markdown
  • Look up table or code block syntax you've forgotten

How to use

  1. Find what you want to do in the You get column.
  2. Type what's shown in the You type column.
  3. Check the GFM rows if your app is based on GitHub's version.

FAQ

How do I make a table in Markdown?

Put a pipe ( | ) between columns, and add a line of hyphens under the header row, like | Name | Age | then |---|---| then | Sam | 30 |. Tables are part of GitHub Flavored Markdown and most modern apps, but not the original Markdown.

How do I add a line break?

Leave a blank line to start a new paragraph. For a line break within a paragraph, end the line with two spaces or a backslash; some apps, like GitHub comments, also treat a single new line as a break.

How do I show an asterisk instead of making text italic?

Put a backslash in front of it: \* shows a literal asterisk. The same works for other characters Markdown uses, such as \_ and \#.