Skip to content
All referenceStructure

Markdown Heading

Learn how to create headings in markdown from H1 to H6 using hash symbols. Syntax, best practices, platform support, and SEO tips.

What is markdown heading?

Markdown headings are created with hash symbols (#). One hash for H1 (largest), two for H2, up to six for H6 (smallest). Headings structure your document and create a hierarchy that readers and search engines can follow.

Syntax

Heading levels

One to six hash symbols create H1 through H6.

Result

Heading 1

Heading 2

Heading 3

Heading 4

Alternative syntax (H1/H2 only)

Underline with = for H1 or - for H2. Less common but valid.

Result

Heading 1

Heading 2

Platform support

PlatformSupportedNotes
GitHubYesAuto-generates anchor links for each heading
GitLabYes
DiscordNoNo heading support
SlackNoNo heading support
RedditYesOnly # for H1 in some contexts
Stack OverflowYes
NotionYesH1-H3 supported, H4-H6 render as H3
ObsidianYes

Common mistakes

Wrong
#Heading
Right
# Heading

A space is required between the hash symbol and the heading text. Without it, some parsers won't render the heading.

Wrong
# Heading 1
# Another Heading 1
Right
# Heading 1
## Sub Heading

A document should have only one H1. Use H2-H6 for subsections to create a proper hierarchy.

Wrong
## Sub Heading
#### Deep Heading
Right
## Sub Heading
### Next Level

Don't skip heading levels (H2 → H4). Go in order: H2 → H3 → H4 for proper document structure.

Tips for heading

1One H1 per document

Use a single # H1 as your document title. Everything else should be ## H2 or deeper. This is important for SEO and accessibility.

2Keep headings short

Headings should be concise labels, not full sentences. Aim for 3-8 words that clearly describe the section.

3Use for structure, not styling

Don't use headings just to make text big. Use them to create a logical document outline that a screen reader could navigate.

Frequently asked questions

Everything you need to know.

1

How many heading levels are there in markdown?

Six levels: # H1 (largest) through ###### H6 (smallest). In practice, most documents use H1-H4.

Related elements

Try it in the editor

Paste your markdown and see heading rendered instantly with professional themes.