MeshWorld India LogoMeshWorld.
MarkdownTutorial4 min read

How to Use Headings in Markdown: A Complete Guide

Hinal Acharya
By Hinal Acharya
|Updated: Jul 14, 2026
How to Use Headings in Markdown: A Complete Guide

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>).

markdown
# Level 1 Heading
## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading
##### Level 5 Heading
###### Level 6 Heading

Here is the HTML equivalent rendered by web browsers:

html
<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>
Always Leave a Space

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 LevelTypical UsageSEO Value
H1Article Title (Only one per page)High
H2Main sub-topics / Question headingsHigh
H3Secondary sections under H2Medium
H4-H6Deep nested detailsLow
Avoid Multiple H1 Headings

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.

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.


Share_This Twitter / X
Hinal Acharya
Written By

Hinal Acharya

A BSc.IT student and a tutor for General Stream in Gujarat, India 🇮🇳. She is passionate about learning new things and food.

Enjoyed this article?

Support MeshWorld and help us create more technical content