Skip to main content
Beta: Front-End Checklist is currently in beta. Some issues are still being fixed. Thanks for your patience.

Maintain logical heading order

Heading levels should follow a sequential, hierarchical order.

Utilities
Quick take
Typical fix time 5 min
  • Use heading levels (`<h1>`-`<h6>`) in sequential order
  • Do not skip heading levels (e.g., `<h1>` followed by `<h3>`)
  • Ensure the document structure is logical and hierarchical
Why it matters: A logical heading structure allows screen reader users to navigate the page content efficiently and helps all users understand the relationship between different sections.

Rule Details

Headings help users understand the structure of a page. Skipping heading levels can confuse users of assistive technology who rely on them for navigation, which is why this rule complements broader heading hierarchy checks.

Code Examples

Correct Implementation

<h1>Main Page Title</h1>
  <h2>Section One</h2>
    <h3>Sub-section A</h3>
  <h2>Section Two</h2>
    <h3>Sub-section B</h3>

Incorrect Implementation

<h1>Main Page Title</h1>
  <h3>Skipped a level!</h3>
    <h5>Skipped again!</h5>

Why It Matters

  • Navigation: Screen reader users often navigate by jumping from heading to heading.
  • Outlining: A correct hierarchy provides an accurate outline of the document content.
  • SEO: Search engines use heading structure to understand the importance and relationship of content.

Best Practices

Start with <h1>: Each page should typically have one primary <h1> representing the main topic.

Sequential Nesting: Only go down one level at a time (<h1> to <h2>, <h2> to <h3>).

Styling != Structure: Don't choose a heading level based on its default font size. Use CSS to style headings while maintaining the correct semantic level.

Don't use headings for styling: Don't use a heading tag just to make text bold or large if it isn't actually a section title.

Exceptions

  • Evaluate the rendered experience before treating a static-code smell as a blocker; interaction timing, browser behavior, and assistive technology output often determine severity.
  • Not every secondary accessibility issue deserves equal weight; prioritize the issue that most directly blocks perception, operation, or understanding.
  • Avoid adding redundant markup or ARIA solely to satisfy a rule when a simpler semantic implementation would eliminate the issue entirely.

Standards

  • Align the implementation with W3C WAI: WCAG Overview and verify the rendered experience, not only the source code.
  • Align the implementation with MDN: Accessibility and verify the rendered experience, not only the source code.

Verification

Automated Checks

  • Inspect the browser accessibility tree or accessibility pane for the relevant element, role, or accessible name.
  • Run an automated accessibility checker such as axe or Lighthouse where applicable.

Manual Checks

  • Test the affected UI with keyboard-only navigation and confirm the rule holds in the rendered experience.
  • Re-test one representative user flow with a screen reader if this rule affects a key interaction.

Use with AI

Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.

Check

Verify implementation

Check the heading structure of the page to ensure that heading levels are not skipped (e.g., check that an <h2> follows an <h1>).

Fix

Auto-fix issues

Adjust the heading levels to ensure a correct hierarchy (e.g., change an <h3> to an <h2> if it follows an <h1>).

Explain

Learn more

Explain how a consistent heading hierarchy aids navigation for screen reader users who rely on heading lists to understand page layout.

Review

Code review

Review the rendered markup and interactive states that affect Maintain logical heading order. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.

Sources

References used to support the guidance in this rule.

Further Reading

Tools and supplementary material for exploring the topic in more depth.

axe DevTools
deque.comTool

Rules that often go hand-in-hand with this one.

Use logical heading hierarchy

Headings follow a sequential structure (h1 to h6) that reflects the content hierarchy without skipping levels.

Accessibility
Ensure headings contain text

All heading elements (h1-h6) must have visible, descriptive content.

Accessibility
Use correct list structure

Lists (ul, ol) should only contain list item elements (li) to ensure they are correctly interpreted by assistive technology.

Accessibility
Use correct definition list structure

Definition lists (&lt;dl&gt;) must only contain valid &lt;dt&gt; and &lt;dd&gt; elements.

Accessibility

Was this rule helpful?

Your feedback helps improve rule quality. This stays internal for now.

Loading feedback...
0 / 385