CheatSheetHub / Markdown Syntax

Markdown Syntax Cheat Sheet

The syntax GitHub, GitLab, and most editors actually render, including the GitHub-Flavored Markdown extras.

Text formatting Headers & lists Links & images Code GitHub extras

Text formatting

**bold**Renders as bold text.
*italic*Renders as italic text.
***bold italic***Renders as bold and italic combined.
~~strikethrough~~Renders as strikethrough (GitHub-Flavored Markdown).
> quoted textRenders as a blockquote.
Line ending in two spaces Forces a line break within the same paragraph.
> nested\n>> quoteNested blockquotes, one > per level.
Term\n: DefinitionA definition list (supported by some renderers, not core Markdown).
\*escaped\*A backslash escapes a Markdown character so it renders literally.

Headers & lists

# H1###### H6Six levels of headers, one to six # characters.
- item or * itemUnordered (bulleted) list item.
1. itemOrdered (numbered) list item.
- nested itemIndent by 2+ spaces to nest a list item.
---A horizontal rule (divider line).
Header text\n=======Alternate H1 syntax: underline text with = signs.
Header text\n-------Alternate H2 syntax: underline text with dashes.
1) itemSome renderers also accept a closing parenthesis for ordered lists.
[ ad space — 336×280 ]

Code

`inline code`Renders as inline monospace code.
```js ... ```A fenced code block with syntax highlighting for the given language.
indented by 4 spacesAlso renders as a code block (older syntax, less common now).
```diff ... ```A diff-highlighted code block showing +/- additions and removals.

GitHub-Flavored Markdown extras

- [ ] todo itemAn unchecked task list checkbox.
- [x] done itemA checked task list checkbox.
| A | B |\n|---|---|\n| 1 | 2 |A table: header row, separator row, then data rows.
:emoji_name:Renders a supported emoji shortcode, e.g. :tada:
@usernameMentions a user (renders as a link on GitHub).
#123Links to an issue or pull request by number, on GitHub.
```mermaid ... ```A Mermaid diagram block, rendered visually on GitHub.
> [!NOTE]A GitHub-styled callout box (Note, Warning, Tip, etc.) inside a blockquote.

Common questions

How do I create a line break without starting a new paragraph?

End the line with two or more spaces before the line break, or use an explicit <br> HTML tag. A single line break with no trailing spaces is usually ignored and rendered as part of the same paragraph.

Why doesn't my Markdown table render correctly?

Every row, including the header, needs pipe characters at the start and end, and the second row must be a separator line made of dashes and optional colons, matching the number of columns in the header.

What's the difference between standard Markdown and GitHub-Flavored Markdown (GFM)?

GFM adds extras on top of standard Markdown: tables, task lists (checkboxes), strikethrough text, automatic URL linking, and syntax-highlighted fenced code blocks. Not all Markdown renderers support these extensions.

Copied