Markdown Headings
Last updated: 2026-10-14
Headings CommonMark core
Start a line with # to create a heading; the number of # marks is the level (1-6) and a space must follow. Headings structure your document: usually one top-level heading per page, then level 2 and 3 below.
| Group | Basic: Block |
|---|---|
| Spec level | CommonMark core |
| Spec version | CommonMark 0.31.2 + GFM |
📝 Syntax
# Level 1
## Level 2
###### Level 6
▶ Live Example
Edit Markdown on the left, see the result on the right
💡 Key points
💡 Tip The space after # is required: #heading will not parse as a heading.
ℹ️ Note Use levels in order and avoid skipping (h2 to h4) — it helps SEO and accessibility.
❓ FAQ
Q Is there a level-7 heading?
A No. HTML only has h1-h6; 7 or more # renders as plain text.
Q Can a page have multiple top-level headings?
A Syntactically yes, but best practice is one h1 per page with h2 and below for the rest.
Q How to add an anchor to a heading?
A Use the extension ## Heading {#custom-id} — see the heading-ids entry.