Cheatsheet

Markdown Syntax Cheatsheet

# Markdown Syntax Cheatsheet

Markdown is a plain-text formatting syntax that renders to HTML. "Markdown" isn't one spec — CommonMark standardized the core rules, and GitHub Flavored Markdown (GFM) layers extensions like tables and task lists on top. This sheet covers both and flags where a renderer might not support a feature.

Quick reference

Headings and emphasis

Syntax Renders as
`# H1` … `###### H6` Heading levels 1–6
`**bold**` or `__bold__` **bold**
`*italic*` or `_italic_` *italic*
`***bold italic***` ***bold italic***
`~~strikethrough~~` (GFM) ~~strikethrough~~
`` `inline code` `` `inline code`

Lists

Syntax Result
`- item` or `* item` Unordered list
`1. item` Ordered list (numbers auto-increment even if you write `1.` repeatedly)
` - nested` Nested list (indent 2+ spaces under the parent marker)
`- [ ] todo` / `- [x] done` (GFM) Task list checkbox

Links and images

Syntax Result
`[text](url)` Link
`[text](url "title")` Link with hover tooltip
`![alt](url)` Image
`[text][ref]` … `[ref]: url` Reference-style link (keeps prose readable, definitions can live at the bottom)
`<https://example.com>` Auto-linked bare URL

Code blocks

const x = 1;

The optional language after the opening fence ( `javascript ) enables syntax highlighting in renderers that support it — it has no effect on the raw text itself.

Tables (GFM only, not core CommonMark)

| Left | Center | Right |
|:---|:---:|---:|
| a | b | c |

The colons in the separator row control column alignment: left (:---), center (:---:), right (---:).

Blockquotes and horizontal rules

Syntax Result
`> quoted text` Blockquote
`> > nested quote` Nested blockquote
`---`, `***`, or `___` on its own line Horizontal rule

Common patterns

Escaping literal Markdown characters

\*not italic\*

Any ASCII punctuation character can be escaped with a leading backslash to render literally instead of being interpreted as syntax — the ones you'll actually need this for are ` \*_{}[]()#+-.! ``, but CommonMark's full escapable set is every ASCII punctuation character, not just these.

Fenced code block inside a list item

1. Run the setup script:
   ```bash
   npm install
   ```
2. Then start the server.

The fence must be indented to align with the list item's content, or most parsers will end the list before the code block.

Line breaks within a paragraph

Line one.
Line two.

A single newline is not a line break in rendered output — CommonMark collapses it into one paragraph with a space. To force a hard break, end the line with two or more trailing spaces, or use <br>.

Pitfalls

  • A single newline doesn't create a new paragraph or line break: you need a fully blank line to start a new paragraph. This trips up anyone writing Markdown the way they'd write plain text with line-wrapped sentences.
  • Tables are GFM, not core CommonMark: a renderer that only implements strict CommonMark (some static-site generators, some Markdown-to-PDF tools) will render a table as literal pipe-and-dash text instead of an HTML table.
  • *Ordered list numbers don't have to be sequential in the source, but the first number sets the start:* 3. item starting a list will render starting at 3, not 1 — a common surprise when reordering list items by hand.
  • Indentation inconsistency breaks nested lists silently: most parsers expect nested content indented by exactly the width of the parent marker (e.g., 1. is 3 characters, so nested content needs 3-space indent) — inconsistent indentation can either flatten the nesting or break out of the list entirely, with no error shown.
  • HTML inside Markdown behaves inconsistently across renderers: CommonMark allows raw HTML passthrough, but many platforms (GitHub comments, some CMSes) sanitize or strip tags for security — don't rely on <div>/<script> working the same way everywhere your Markdown gets rendered.

Related ZipKit tools

  • Text Diff Checker — compare two Markdown drafts line-by-line to spot exactly what changed before committing docs.
  • Case Converter — normalize heading or label casing before dropping text into a Markdown document.

Related cheatsheets

  • JSON Syntax Reference — the data format most static-site generators pair with Markdown frontmatter.
  • Git Commands Cheatsheet — Markdown is the format almost every README and commit-adjacent doc in a git repo is written in.