Organizing web content logically is essential for keeping readers engaged and improving search visibility. Properly structured headings divide long walls of text into readable sections, guide screen readers, and signal topic importance to search engines. This guide shows you how to implement, format, and optimize headings in Markdown for better layout and accessibility.
Key Takeaways
- Use one to six hashtags (#) to define heading levels 1 through 6.
- Always keep a single space between the hashtag and the heading text.
- Maintain a strict hierarchy (H1 to H2 to H3) without skipping levels for optimal accessibility.
- Include primary keywords in headings to improve on-page SEO.
How to Create Headings in Markdown?
To create a heading in Markdown, start a line with one or more hashtags (#) followed by a single space and your heading text. The number of hashtags corresponds to the HTML heading level.
For example, a single hashtag creates a Level 1 Heading (HTML <h1>), while two hashtags create a Level 2 Heading (HTML <h2>).
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 HeadingHere is the HTML equivalent rendered by web browsers:
<h1>Level 1 Heading</h1>
<h2>Level 2 Heading</h2>
<h3>Level 3 Heading</h3>
<h4>Level 4 Heading</h4>
<h5>Level 5 Heading</h5>
<h6>Level 6 Heading</h6>Make sure to put a space between the # characters and your heading text (for example, # Heading instead of #Heading). While some Markdown parsers are forgiving, many strict parsers will fail to render the heading without the space.
How Do Headings Help Visually Impaired Readers?
Visually impaired readers often rely on screen readers to navigate web pages. Screen readers scan the page and read the headings aloud so the user can understand the structure of the document.
By navigating from heading to heading, users can quickly get the gist of an article and decide if they want to read a specific section. Using descriptive, correctly structured headings makes your content accessible to everyone.
How Do Markdown Headings Improve On-Page SEO?
Search engine crawlers analyze headings to understand the main topics of your content. Placing target keywords naturally in your H2 and H3 headings helps search engines index your pages for relevant search queries.
| Heading Level | Typical Usage | SEO Value |
|---|---|---|
| H1 | Article Title (Only one per page) | High |
| H2 | Main sub-topics / Question headings | High |
| H3 | Secondary sections under H2 | Medium |
| H4-H6 | Deep nested details | Low |
Always use only one Level 1 heading (#) per article. This should match the title of your post. Using multiple <h1> tags confuses search engine crawlers and hurts accessibility.
Summary Checklist
- Use
#through######to set headings from level 1 to 6. - Add a space between the
#symbol and your text. - Follow hierarchical order (H2 -> H3 -> H4), never skipping levels.
- Use one H1 per page for the main article title.
- Optimize H2s and H3s by including relevant keywords.
Frequently Asked Questions
Can I write headings using underlines?
Yes, Markdown supports Setext-style headings where you underline the heading text with = (for H1) or - (for H2). However, standard ATX style (using #) is widely preferred because it is easier to read and maintain.
Does capitalization matter in headings?
Capitalization does not affect Markdown compilation or SEO rankings, but you should choose a style (like Title Case or Sentence Case) and use it consistently across your site.
Should I put links inside headings?
It is technically possible to place links inside headings in Markdown, but it is generally discouraged because it creates a poor user experience and can interfere with screen readers.
What to Read Next
- Markdown List Guide: Ordered and Unordered Lists — Learn how to format ordered, unordered, and nested lists.
- How to Create Links in Markdown — Master the syntax for embedding hyperlinks and email addresses.
Related Articles
Deepen your understanding with these curated continuations.

Autolinks in Markdown: Bare URLs and Emails
Learn the difference between CommonMark's angle-bracket autolinks and GitHub-Flavored Markdown's extended autolinks for bare URLs and email addresses.

Definition Lists in Markdown
Learn the Markdown Extra-style definition list syntax for terms and descriptions, useful for glossaries and API documentation, plus which tooling supports it.

Escaping Special Characters in Markdown
Learn how to escape asterisks, underscores, brackets, and other special characters in Markdown so they display as literal text instead of triggering formatting.


