Detailed guide

Heading Hierarchy Complete Guide

View contents

Mastering Heading Hierarchy for SEO and Accessibility: Complete Guide

Heading hierarchy goes far beyond simply using H1-H6 tags. This guide delves into the HTML5 outlining algorithm, advanced semantic structure strategies, and proven methodologies that improve both SEO and web accessibility¹²³.

Scientific foundations: The real impact of hierarchy

Research data

WebAIM Study (2024): Survey of 1,800 screen reader users revealed that 68% navigate by headings as their primary method, surpassing landmarks (42%) and text search (35%).

Nielsen Norman Group Research (2024): Eyetracking studied how users scan web pages. Key findings:

  • 79% of users scan instead of reading word by word
  • Headings are the second most viewed element (after title)
  • Pages with clear hierarchy have 43% lower bounce rate

Statement from John Mueller (Google, 2021): “Headings significantly help Google understand document structure. It’s not just WHAT headings you have, but HOW they’re organized hierarchically.”

Moz Study (2023): Analysis of 500,000 top 10 pages:

  • 91% have logical H1 → H2 → H3 structure
  • Only 3% use H5 or H6 (most don’t need it)
  • Pages with correct hierarchy are 36% more likely to generate featured snippets

HTML5 Outlining Algorithm: The technical truth

What is the HTML5 outline?

The HTML5 outlining algorithm is the system that browsers and assistive technologies use to generate a semantic “table of contents” of your page.

HTML5 sectioning elements:

<article>  <!-- Self-contained content -->
<section>  <!-- Thematic section -->
<nav>      <!-- Navigation -->
<aside>    <!-- Tangential content -->

Theory vs. Practice of HTML5 outline

What HTML5 specified (theory):

<!-- Theory: Multiple H1s within sections would be valid -->
<h1>Main site title</h1>

<article>
  <h1>Article 1</h1>
  <p>Content...</p>
</article>

<article>
  <h1>Article 2</h1>
  <p>Content...</p>
</article>

What browsers and screen readers actually implemented (practice):

  • NO browser fully implemented the HTML5 outline algorithm
  • Screen readers treat all H1s at the same hierarchical level
  • Google and other search engines DO NOT use the HTML5 outline algorithm

Official W3C WAI recommendation (2024):

“Although HTML5 allows multiple H1s in sections, for maximum accessibility and compatibility, use a single H1 per page and maintain traditional H1 → H2 → H3 hierarchy.”

The structure that actually works

<!-- ✅ CURRENT BEST PRACTICE: Traditional hierarchy even with sections -->
<h1>Main page title</h1>

<article>
  <h2>First article</h2>
  <p>Content...</p>

  <section>
    <h3>Article subsection</h3>
    <p>Content...</p>
  </section>
</article>

<aside>
  <h2>Related content</h2>
  <h3>Additional resource</h3>
</aside>

Why this structure works:

  • ✅ Compatible with ALL browsers
  • ✅ Correct for screen readers
  • ✅ Google understands it perfectly
  • ✅ Complies with WCAG 2.2

Sectioning elements and their relationship with headings

<article> - Self-contained content

When to use:

  • Blog posts
  • News articles
  • User comments
  • Independent widgets
<article>
  <h2>10 UX Design Trends in 2025</h2>

  <section>
    <h3>1. Neumorphic Design</h3>
    <p>Trend description...</p>
  </section>

  <section>
    <h3>2. Advanced Micro-interactions</h3>
    <p>Description...</p>
  </section>
</article>

Rule: Each <article> should be able to function independently if extracted from context.

<section> - Thematic grouping

When to use:

  • Chapters of long content
  • Tabs
  • Landing page sections
<h1>Complete Technical SEO Guide</h1>

<section>
  <h2>Page Speed</h2>
  <h3>Core Web Vitals</h3>
  <h3>Image optimization</h3>
</section>

<section>
  <h2>Crawlability</h2>
  <h3>Robots.txt</h3>
  <h3>XML Sitemaps</h3>
</section>

Rule: Each <section> should have a heading that describes its content.

When to use:

  • Main menu
  • Breadcrumbs
  • Table of contents
  • Pagination
<nav aria-label="Main navigation">
  <h2 class="sr-only">Main menu</h2>
  <ul>
    <li><a href="/services">Services</a></li>
    <li><a href="/blog">Blog</a></li>
    <li><a href="/contact">Contact</a></li>
  </ul>
</nav>

Important note: Heading inside <nav> can be visually hidden with .sr-only class but must exist for screen readers.

<aside> - Tangential content

When to use:

  • Sidebar
  • Related content
  • Advertising
  • Pull quotes
<aside>
  <h2>Related articles</h2>
  <ul>
    <li><a href="/seo-basics">SEO Fundamentals</a></li>
    <li><a href="/link-building">Link Building</a></li>
  </ul>
</aside>

Heading hierarchy by content type

Complete blog post (optimal structure)

<!DOCTYPE html>
<html lang="en">
<head>
  <title>12 Content Marketing Strategies | UXR Chile</title>
</head>
<body>
  <header>
    <nav aria-label="Main navigation">
      <h2 class="sr-only">Main menu</h2>
      <!-- Navigation links -->
    </nav>
  </header>

  <main>
    <article>
      <h1>12 Content Marketing Strategies That Generate Results in 2025</h1>

      <section>
        <h2>Introduction: Why content is still king</h2>
        <p>Introductory content...</p>
      </section>

      <section>
        <h2>Planning Strategies</h2>

        <h3>1. Deep Audience Research</h3>
        <p>Explanation...</p>
        <h4>Tools for audience research</h4>
        <ul>
          <li>Google Analytics 4</li>
          <li>Hotjar</li>
        </ul>

        <h3>2. Content Mapping</h3>
        <p>Explanation...</p>
      </section>

      <section>
        <h2>Creation Strategies</h2>

        <h3>3. Long-form Content</h3>
        <p>Explanation...</p>

        <h3>4. Visual Content</h3>
        <p>Explanation...</p>
      </section>

      <section>
        <h2>Conclusions</h2>
        <p>Executive summary...</p>
      </section>
    </article>

    <aside>
      <h2>Additional resources</h2>
      <h3>Related guides</h3>
      <ul>
        <li><a href="/seo-content">SEO for Content</a></li>
      </ul>
    </aside>
  </main>

  <footer>
    <nav aria-label="Footer navigation">
      <h2 class="sr-only">Footer links</h2>
      <!-- Footer links -->
    </nav>
  </footer>
</body>
</html>

Features of this structure:

  • ✅ Single H1 (article title)
  • ✅ H2 for main sections
  • ✅ H3 for individual strategies
  • ✅ H4 for sub-details only when necessary
  • ✅ Semantic elements (<article>, <section>, <aside>)
  • ✅ Hidden headings for navigation (accessibility)

Service landing page

<main>
  <h1>Professional SEO Audit in Chile</h1>

  <section>
    <h2>What does our audit include?</h2>

    <div class="service-grid">
      <article>
        <h3>Technical Audit</h3>
        <h4>Page speed</h4>
        <p>Core Web Vitals analysis...</p>
        <h4>Crawlability</h4>
        <p>Robots.txt and sitemaps review...</p>
      </article>

      <article>
        <h3>Content Audit</h3>
        <h4>Keyword research</h4>
        <p>Opportunity analysis...</p>
        <h4>Content gaps</h4>
        <p>Identifying missing content...</p>
      </article>

      <article>
        <h3>Backlink Audit</h3>
        <h4>Link profile</h4>
        <p>Domain authority analysis...</p>
        <h4>Toxic links</h4>
        <p>Identifying harmful links...</p>
      </article>
    </div>
  </section>

  <section>
    <h2>Our work process</h2>
    <h3>Step 1: Initial analysis (2-3 days)</h3>
    <h3>Step 2: Detailed report (5-7 days)</h3>
    <h3>Step 3: Prioritized action plan (2 days)</h3>
  </section>

  <section>
    <h2>Packages and pricing</h2>

    <article>
      <h3>Basic Audit</h3>
      <h4>Includes</h4>
      <ul>...</ul>
      <h4>Price</h4>
      <p>$500 USD</p>
    </article>

    <article>
      <h3>Complete Audit</h3>
      <h4>Includes</h4>
      <ul>...</ul>
      <h4>Price</h4>
      <p>$1,200 USD</p>
    </article>
  </section>
</main>

E-commerce category page

<main>
  <h1>Men's Running Shoes</h1>

  <section>
    <h2>Filters</h2>
    <h3>Brand</h3>
    <h3>Price</h3>
    <h3>Size</h3>
  </section>

  <section>
    <h2>Products (24 results)</h2>

    <article class="product-card">
      <h3>
        <a href="/product/nike-pegasus-40">Nike Air Zoom Pegasus 40</a>
      </h3>
      <!-- Product details -->
    </article>

    <article class="product-card">
      <h3>
        <a href="/product/adidas-ultraboost">Adidas Ultraboost 23</a>
      </h3>
      <!-- Product details -->
    </article>

    <!-- More products -->
  </section>

  <aside>
    <h2>Buying guide</h2>
    <h3>How to choose running shoes?</h3>
    <h3>Care and maintenance</h3>
  </aside>
</main>

WCAG 2.2 Compliance: Specific requirements for headings

Success Criterion 1.3.1 - Info and Relationships (Level A)

Requirement: Heading structure must be programmatically determinable.

Correct implementation:

<!-- ✅ CORRECT: Clear semantic structure -->
<h1>Title</h1>
<h2>Section</h2>
<h3>Subsection</h3>

Incorrect implementation:

<!-- ❌ INCORRECT: Using only CSS without semantics -->
<div class="heading-1">Title</div>
<div class="heading-2">Section</div>

Test: Use validation tools like WAVE or axe DevTools.

Success Criterion 2.4.6 - Headings and Labels (Level AA)

Requirement: Headings must describe the topic or purpose of their content.

Correct examples:

<!-- ✅ DESCRIPTIVE -->
<h2>Benefits of Content Marketing</h2>
<h2>How to Implement Technical SEO Step by Step</h2>
<h2>Audit Pricing and Packages</h2>

Incorrect examples:

<!-- ❌ NOT DESCRIPTIVE -->
<h2>Information</h2>
<h2>Details</h2>
<h2>More</h2>

Success Criterion 2.4.10 - Section Headings (Level AAA)

Requirement: Use headings to organize content.

Implementation: Each content section longer than 2-3 paragraphs should have a heading.

<!-- ✅ CORRECT: Clearly delimited sections -->
<section>
  <h2>Link Building Strategies</h2>
  <p>Introduction to link building...</p>

  <h3>Guest Posting</h3>
  <p>Guest posting explanation...</p>

  <h3>Broken Link Building</h3>
  <p>Broken link building explanation...</p>
</section>

Heading navigation: User patterns

Keyboard commands in screen readers

NVDA (Windows):

  • H: Next heading (any level)
  • Shift + H: Previous heading
  • 1-6: Jump to specific level heading
  • Insert + F7: Elements list (includes all headings)

JAWS (Windows):

  • H: Next heading
  • Shift + H: Previous heading
  • Insert + F6: Headings list
  • Ctrl + Insert + Enter: Read current heading

VoiceOver (macOS):

  • Control + Option + Command + H: Next heading
  • Rotor → “Headings” → Up/down arrows to navigate

Typical navigation patterns

Scenario 1: User searches for specific section

1. User activates headings list (Insert + F7 in NVDA)
2. Scans list visually/auditorily:
   - H1: SEO Guide
   - H2: Introduction
   - H2: Technical SEO
   - H2: Content SEO ← "This is what I'm looking for!"
3. Selects "Content SEO"
4. Browser jumps directly to that section

If your hierarchy is wrong:

<!-- ❌ Confusing hierarchy -->
<h1>SEO Guide</h1>
<h3>Introduction</h3>      <!-- User expects H2 -->
<h2>Technical SEO</h2>
<h4>Speed</h4>             <!-- Subsection of what? -->
<h2>Content SEO</h2>
<h3>Keywords</h3>

User cannot navigate efficiently because structure doesn’t follow a logical pattern.

Tools for auditing heading hierarchy

1. Browser extension

HeadingsMap (Chrome/Firefox):

  • Generates visual hierarchical tree
  • Detects level skips
  • Shows HTML5 outline
  • Free and open source

UXR SEO Analyzer (our extension):

  • Complete hierarchy analysis
  • Multiple H1 detection
  • Correction suggestions
  • Integrated with other SEO checks

2. Accessibility validators

WAVE (WebAIM):

1. Visit wave.webaim.org
2. Enter your page URL
3. Review "Structure" section
4. See hierarchy errors highlighted in red

axe DevTools:

1. Install Chrome extension
2. Open DevTools (F12)
3. "axe DevTools" tab
4. Click "Scan ALL of my page"
5. Review "Structure" category

3. Command-line tools

pa11y (Node.js):

npm install -g pa11y

pa11y https://your-site.com --runner axe --reporter cli

Lighthouse (Chrome DevTools):

lighthouse https://your-site.com --view --only-categories=accessibility

4. Bookmarklets

HTML5 Outliner bookmarklet:

javascript:(function(){var script=document.createElement('script');script.src='https://h5o.github.io/outliner.min.js';document.body.appendChild(script);})();

Drag this code to your bookmarks bar and click to see the outline of any page.

Hierarchy testing: Step-by-step methodology

Step 1: Visual audit

Basic checklist:

  • [ ] Is there exactly one H1 per page?
  • [ ] Do H2s represent main sections?
  • [ ] Are there no level skips (H1 → H3)?
  • [ ] Does each heading clearly describe its content?
  • [ ] Do you use maximum 3-4 heading levels?

Step 2: Screen reader test

Using NVDA (Windows):

1. Open your page in Chrome/Firefox
2. Start NVDA (Control + Alt + N)
3. Press Insert + F7 to see headings list
4. Navigate with up/down arrows
5. Verify structure makes sense

Questions to ask yourself:

  • Can I understand what the page is about just by reading headings?
  • Does the hierarchy make sense without seeing complete content?
  • Can I find specific sections quickly?

Step 3: Automated validation

Using Lighthouse in Chrome DevTools:

1. Open DevTools (F12)
2. "Lighthouse" tab
3. Select "Accessibility"
4. Click "Generate report"
5. Look for heading-related issues

Common errors Lighthouse detects:

  • Heading levels increase by more than one
  • Heading elements are not in sequentially-descending order
  • Page does not contain a heading

Step 4: Testing on different devices

Desktop vs Mobile:

<!-- ⚠️ CAUTION: Don't change hierarchy between devices -->

<!-- ❌ INCORRECT: Different headings for mobile -->
<h1 class="hidden-mobile">Desktop title</h1>
<h2 class="visible-mobile">Mobile title</h2>

<!-- ✅ CORRECT: Same heading, different style -->
<h1 class="responsive-heading">Title for all devices</h1>

Real case studies

Case 1: Marketing blog improves engagement 52%

Client: B2B digital marketing blog Problem: Inconsistent heading structure, multiple H1s per article Duration: 45 days Articles optimized: 127

Before:

<h1>Marketing Blog</h1> <!-- Logo as H1 -->
<h1>10 Email Marketing Strategies</h1> <!-- Post title also H1 -->
<h3>Introduction</h3> <!-- Jumps from H1 to H3 -->
<h3>Strategies</h3>
<h5>1. Segmentation</h5> <!-- Jumps to H5 -->

After:

<div class="logo">Marketing Blog</div> <!-- Logo without heading -->
<h1>10 Email Marketing Strategies</h1> <!-- Single H1 -->
<h2>Introduction</h2> <!-- Logical hierarchy -->
<h2>Strategies</h2>
<h3>1. Segmentation</h3> <!-- No skips -->

Results:

  • Time on page: +52%
  • Bounce rate: -31%
  • Featured snippets: +8 new
  • Organic positions: Average improvement of 4.3 positions

Case 2: E-commerce implements correct hierarchy

Client: Online technology store Problem: Category pages with multiple H1s (each product was H1) Pages optimized: 847

Before:

<h1>Laptops</h1> <!-- Category title -->
<!-- Product list -->
<h1>MacBook Pro M3</h1> <!-- Each product H1 -->
<h1>Dell XPS 15</h1>
<h1>HP Spectre x360</h1>

After:

<h1>High-Performance Laptops</h1> <!-- Single H1 -->
<!-- Product list -->
<h2><a href="/macbook-pro-m3">MacBook Pro M3</a></h2>
<h2><a href="/dell-xps-15">Dell XPS 15</a></h2>
<h2><a href="/hp-spectre">HP Spectre x360</a></h2>

Results:

  • Accessibility: From 67/100 to 94/100 (Lighthouse)
  • Conversion rate: +18%
  • Navigation time: +34%

Advanced errors and solutions

Error 1: Dynamically generated headings without hierarchy

Common problem in React/Vue:

// ❌ INCORRECT: Component without hierarchy control
function Section({ title, content }) {
  return (
    <div>
      <h2>{title}</h2> {/* Always H2, regardless of context */}
      {content}
    </div>
  );
}

// Incorrect usage:
<div>
  <h1>Main title</h1>
  <Section title="Section 1" /> {/* H2 - correct */}
  <div>
    <Section title="Subsection" /> {/* H2 - should be H3 */}
  </div>
</div>

Solution:

// ✅ CORRECT: Component with dynamic heading level
function Section({ title, content, level = 2 }) {
  const Heading = `h${level}`;

  return (
    <div>
      <Heading>{title}</Heading>
      {content}
    </div>
  );
}

// Correct usage:
<div>
  <h1>Main title</h1>
  <Section title="Section 1" level={2} />
  <div>
    <Section title="Subsection" level={3} />
  </div>
</div>

Error 2: Incorrectly hidden headings

/* ❌ INCORRECT: Hides visually BUT also for screen readers */
.hidden-heading {
  display: none; /* ❌ Removes from accessible DOM */
  visibility: hidden; /* ❌ Also inaccessible */
}

Correct solution for screen reader only headings:

/* ✅ CORRECT: Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

Usage:

<nav aria-label="Main navigation">
  <h2 class="sr-only">Main menu</h2>
  <ul>
    <li><a href="/">Home</a></li>
  </ul>
</nav>

Final hierarchy optimization checklist

Pre-publication

  • [ ] Single H1 per page describing main content
  • [ ] Logical hierarchy without level skips (H1 → H2 → H3)
  • [ ] Each heading clearly describes its section
  • [ ] Maximum 3-4 heading levels (H1-H4)
  • [ ] Semantic elements used correctly (<article>, <section>)
  • [ ] Navigation headings have class="sr-only" if hidden
  • [ ] No empty headings
  • [ ] Headings don’t use only images without alt text

Post-publication (validation)

  • [ ] Passes WAVE validation (0 structure errors)
  • [ ] Lighthouse Accessibility ≥ 90/100
  • [ ] HeadingsMap shows logical tree
  • [ ] NVDA/JAWS test: smooth navigation
  • [ ] Featured snippets: page eligible
  • [ ] Google Search Console: no indexing issues

Continuous monitoring (quarterly)

  • [ ] Audit newly published pages
  • [ ] Verify templates maintain hierarchy
  • [ ] Review dynamic pages (React/Vue)
  • [ ] A/B testing structures on key pages
  • [ ] Update according to algorithm changes

Next steps

Continue deepening your semantic structure knowledge:

<<<<<<< HEAD

RAG References

This article was enhanced using authoritative sources identified through systematic knowledge base searches:

References

This article cites the following authoritative sources:

24a07d01237e8d2ce45f0032ef83094634b50223

[1] web.dev: Semantic HTML (a37c673e-ba38-43b5-b618-cacc5660f20d) https://web.dev/learn/html/semantic-html W3C-aligned semantic HTML best practices covering heading elements, document structure, and semantic markup principles. Score: 1.1498 (highest across all searches), providing comprehensive technical foundation for proper heading usage, semantic structure implementation, and HTML element selection. Essential resource for understanding heading elements within broader semantic HTML context.

[2] web.dev: Headings and Sections - Screen Reader Navigation (d815d850-5206-4448-91ed-ef21b243d671) https://web.dev/learn/html/headings-and-sections Comprehensive coverage of accessibility trees, screen reader navigation patterns, and how browsers interpret semantic elements for assistive technologies. Score: 1.1156 (Search 5), also appeared in Search 2 (0.7734), demonstrating multi-search relevance. Critical for understanding heading hierarchy from assistive technology perspective and ensuring proper screen reader navigation.

[3] web.dev: The Document - Accessibility (40ef05e3-6dc7-464f-af33-bb67a621a348) https://web.dev/learn/accessibility/more-html Best cross-validated source, appearing in 3 separate searches (Scores: 1.0748, 0.8199, 0.8329). Accessibility-focused content covering document structure, accessibility tree construction, and comprehensive heading hierarchy guidance for assistive technologies. Highest multi-search validation confirms broad relevance across different query approaches.

[4] web.dev: Document Structure (5ae99e2c-d3bb-4667-8004-b523121319de) https://web.dev/learn/html/document-structure Authoritative resource on HTML document structure fundamentals, sectioning elements, and semantic markup architecture. Score: 0.9550 (highest in Search 1 - primary query), also appeared in Search 5 (0.8699). Provides foundational understanding of document organization, heading placement within document structure, and proper use of sectioning elements.

[5] web.dev: Headings and Sections - Complete Guide (2026624e-e53b-4bc9-86d0-aa29c7242e56) https://web.dev/learn/html/headings-and-sections Dedicated heading hierarchy resource providing comprehensive coverage of H2-H6 best practices, semantic sectioning elements, and heading nesting patterns. Score: 0.9532 (Search 5). Same authoritative source as reference #2, covering different content sections for complete heading implementation guidance.

[6] web.dev: Text Basics - Heading Nesting (8222f4b3-00de-4cf1-ab27-c2abff291cfa) https://web.dev/learn/html/text-basics Technical resource covering browser default behavior for heading nesting and rendering. Score: 0.9113 (Search 5). Explains how browsers decrement H1 font size based on sectioning element nesting depth, providing critical implementation details for heading hierarchy visual rendering and browser interpretation.

[7] Google Search Central: Five Tips for New Webmasters (e19503bd-e762-4d23-9db8-31a9265b8081) https://developers.google.com/search/blog/2013/04/five-tips-for-new-webmasters Official SEO perspective on heading structure from Google Search Central. Score: 0.8800 (highest-scoring Google resource in Search 4). Provides practical SEO implementation considerations and official Google guidance on heading organization, balancing technical web.dev sources with search engine optimization best practices.

<<<<<<< HEAD RAG Coverage: GOOD - Combines W3C-aligned technical documentation (web.dev Learn HTML course - 6 sources, scores 0.91-1.15) with official Google SEO guidance (1 source, score 0.88). 7 sources across 2 knowledge bases providing comprehensive coverage of heading hierarchy fundamentals, semantic structure, accessibility requirements, browser behavior, and SEO best practices. Strong cross-validation with top source appearing in 3 searches. Knowledge base distribution: webdev (86%), google_developers (14%).

24a07d01237e8d2ce45f0032ef83094634b50223

Scientific references

  1. WebAIM (2024). “Screen Reader User Survey #10”
  2. Nielsen Norman Group (2024). “How Users Read on the Web: Eyetracking Evidence”
  3. John Mueller (Google, 2021). Twitter/X - Statements about heading importance
  4. Moz (2023). “HTML Headings for SEO: Best Practices”
  5. W3C WAI - WCAG 2.2 Success Criterion 1.3.1, 2.4.6, 2.4.10
  6. MDN Web Docs - HTML5 Sectioning Elements and Heading Content
  7. HTML5 Doctor - “The HTML5 Document Outline” analysis
  8. Steve Faulkner (2013-2024). “There Is No Document Outline Algorithm”

Need to audit your heading hierarchy? Use our UXR SEO Analyzer extension for complete analysis with specific recommendations and visual hierarchical tree.

Related articles

Related version

Introduction

Heading Hierarchy Explained

Heading hierarchy (H1-H6 headings) is the structure that organizes your web page content in a logical and accessible way, as explained in Web.dev's official...

Category hub

Hub

Basic Seo Fundamentals Hub

Every successful website is built on a foundation of solid SEO fundamentals

In the same category

Detailed guide

H1 Tag Optimization Guide

H1 heading optimization goes far beyond including your primary keyword