Markdown Syntax Cheat Sheet
Markdown is a lightweight way to format plain text that converts cleanly to HTML — used in READMEs, docs, chat apps, and static sites. The core syntax below works almost everywhere; a few items noted as GFM are GitHub-Flavored Markdown extensions.
Updated 2026-07-06
Text & inline
| Element | Syntax | Notes |
|---|---|---|
| Heading 1 | # Heading | One # per level, up to ###### |
| Heading 2 | ## Heading | Two hashes |
| Bold | **bold text** | Or __bold text__ |
| Italic | *italic text* | Or _italic text_ |
| Bold + italic | ***both*** | Three asterisks |
| Strikethrough | ~~struck~~ | GitHub-flavored Markdown |
| Inline code | `code` | Wrap in single backticks |
| Link | [text](https://url.com) | Text in [], URL in () |
| Image |  | Like a link with a leading ! |
| Blockquote | > quoted text | Add > to each line |
| Horizontal rule | --- | Three or more dashes on their own line |
Lists
| Element | Syntax | Notes |
|---|---|---|
| Bullet list | - item | Or * item / + item |
| Numbered list | 1. item | Numbers can all be 1. |
| Nested item | - subitem | Indent two spaces |
| Task list | - [ ] to do | - [x] done (GFM) |
Blocks
In the syntax column, \n marks where a new line goes.
| Element | Syntax | Notes |
|---|---|---|
| Code block | ```lang\ncode\n``` | Fence with three backticks; lang is optional |
| Table | | A | B |\n|---|---|\n| 1 | 2 | | Pipes separate cells; --- row sets the header |
| Line break | end with two spaces | Or a backslash at line end |
| Escape | \* literal asterisk | Backslash before a special character |
Related tools