Markdown syntax reference
Markdown cheat sheet
A quick reference for Markdown syntax: headings, emphasis, lists, links, images, code, tables, task lists, and GitHub Flavored Markdown extensions.
Headings
Use one to six `#` symbols at the start of a line. The number of hashes sets the heading level.
| Markdown | Result |
|---|---|
# Heading 1 | Largest heading |
## Heading 2 | Section heading |
### Heading 3 | Subsection heading |
Keep one H1 per document and nest the rest in order. Clear heading hierarchy helps readers, search engines, and AI tools understand structure.
Bold, italic, and strikethrough
| Markdown | Result |
|---|---|
**bold** | bold |
_italic_ | italic |
***bold italic*** | bold italic |
~~strikethrough~~ | |
`inline code` | inline code |
Lists and task lists
Use `-`, `*`, or `+` for bullet lists, and numbers for ordered lists. Indent to nest. GitHub Flavored Markdown adds task lists with `- [ ]` and `- [x]`.
- Bullet item
- Nested item
1. First step
2. Second step
- [ ] Open task
- [x] Completed task Links and images
Links wrap text in square brackets followed by the URL in parentheses. Images use the same pattern with a leading `!`.
[Link text](https://example.com)
[Link with title](https://example.com "Tooltip")

[Reference link][ref]
[ref]: https://example.comAlways write descriptive alt text for images. It improves accessibility and SEO.
Code blocks
Wrap inline code in single backticks. For multi-line code, use three backticks (a fenced code block) and add a language name for syntax highlighting.
```js
function hello() {
return "hi";
}
``` Blockquotes and rules
Start a line with `>` for a blockquote. Use three or more dashes on their own line for a horizontal rule.
> This is a quote.
>> Nested quote.
--- Tables
Use pipes `|` to separate columns and a row of dashes to mark the header. Colons set column alignment: `:---` left, `:---:` center, `---:` right.
| Name | Role | Count |
| :---- | :-----: | ----: |
| Alice | Admin | 12 |
| Bob | Editor | 7 |Tables are part of GitHub Flavored Markdown. You can build and preview them instantly in the online Markdown editor.
Escaping characters
To show a Markdown character literally, put a backslash before it. For example, `\*not italic\*` renders as plain text with asterisks instead of italics. This is useful when writing about Markdown syntax itself.
Standard Markdown vs GitHub Flavored Markdown
Core Markdown (CommonMark) covers headings, emphasis, lists, links, images, code, and blockquotes. GitHub Flavored Markdown (GFM) adds tables, task lists, strikethrough, and automatic URL links. Most modern tools, including Markdown Docs, support both, but very simple renderers may only handle the core syntax.
Practice with a live preview
The fastest way to learn Markdown is to type it and watch it render. Open the Markdown Docs online editor to test this cheat sheet, or download Markdown Docs to edit `.md` files on Windows with live preview. For more, see online Markdown editing and opening .md files on Windows.
Related references
- CommonMark specification for standard Markdown syntax.
- GitHub Flavored Markdown spec for GFM extensions like tables and task lists.
FAQ
What is the difference between * and _ in Markdown?
Both create emphasis. A single * or _ makes italic text, and a double ** or __ makes bold. Many writers use ** for bold and _ for italic for readability.
How do I make a table in Markdown?
Separate columns with pipes and add a row of dashes under the header. Use colons in the dash row to align columns left, center, or right.
Does Markdown support task lists?
Yes, in GitHub Flavored Markdown. Use "- [ ]" for an unchecked item and "- [x]" for a checked item.
How do I add a code block with highlighting?
Wrap the code in three backticks and write the language name right after the opening backticks, for example ```js for JavaScript.