All HTML guides
Accessibility6 min read

How to Create a Clear HTML Heading Structure

Turn a visual page into a dependable outline that helps readers scan, navigate, and understand the content.

The short version

Headings are the table of contents embedded in the page.

01

Write the outline before styling it

Most pages should have one clear h1 that names the page. Major ideas beneath it use h2, and details inside those sections use h3. The number describes hierarchy, not font size.

A reader should be able to skim only the headings and still understand the argument. If the outline feels vague or repetitive, the body will usually feel that way too.

02

Avoid skipped levels and decorative headings

Jumping from h2 to h4 suggests a missing level. Using a heading because it happens to be bold creates a false section in the document outline. Use CSS classes for appearance and reserve heading elements for sections.

html
<main>
  <h1>Migration plan</h1>
  <section>
    <h2>Current system</h2>
    <h3>Known constraints</h3>
  </section>
  <section>
    <h2>Proposed rollout</h2>
    <h3>Phase one</h3>
  </section>
</main>
03

Make headings do real navigation work

Add stable ids when headings need direct links. Keep the visible wording concise and specific. In long documents, a generated table of contents can link to those ids without creating a second navigation model.

When an AI agent drafts the page, ask it to return the heading outline separately. Reviewing that outline first is a fast way to catch duplicated sections and missing transitions.

Official references

Keep going

Related HTML guides