glossary

Header Tags (H1-H6): How to Structure Pages for SEO

Header tags (H1 to H6) give a page its outline. See the correct SEO header structure, a nesting example, and which rules Google cares about.

updated:

Header tags are the H1 to H6 HTML elements that define the headings and subheadings on a page, giving it a machine-readable outline. The short version of good SEO header structure: one H1 that names the page, H2s for its main sections, H3s for subsections inside an H2, and each heading worded so it describes the passage below it. A crawler, a screen reader and an AI retrieval system all use that outline to work out what the page covers and how its parts relate.

Header Tags

Header tags are the six HTML heading elements (<h1> through <h6>) that mark up a page’s headings and subheadings, expressing content hierarchy and section importance to both users and search engines.

What header tags actually do

A header tag is structure that happens to come with a default visual style. Google, assistive technology and language models all read the semantic tag; the font size you set in CSS means nothing to them. A line of text that looks like a heading but sits in a <div> with a 28px font carries no heading weight at all.

The six levels form a nesting order:

  • H1: the page’s main heading, describing the whole page.
  • H2: major sections under the H1.
  • H3: subsections that belong to a specific H2.
  • H4: finer detail beneath an H3 (step lists, technical sub-points).
  • H5: minor subheadings, used sparingly on dense pages.
  • H6: the lowest level; rarely needed in practice.

The H1 has its own rules on length, count and how it relates to the title tag, covered in the H1 tag entry. This entry is about the whole ladder and how the rungs relate.

The fastest header audit we run: strip all CSS and read the page as a plain outline. If that outline tells the story of the page on its own, the headers are doing their job. If it reads as gibberish, no amount of body copy will save it.

H1 to H6 tag structure at a glance

TagRolePer pageCommon mistake
H1Page’s main headingOne is best practiceA logo or site name as the H1, or none at all
H2Major sectionsAs many as neededUsed for sidebar and footer labels
H3Subsections under an H2As neededPicked for its size, out of order
H4Detail under an H3SparinglyTreated as a “small H2”
H5Minor subheadingsRarelyDecorative use
H6Lowest levelAlmost neverFiller that adds no structure

The pattern that holds across all six: descend one level at a time. Jumping back up is fine (an H4 followed by the next H2), but going from an H2 straight to an H4 leaves a gap that screen-reader users notice and that accessibility checkers flag.

Why SEO header structure matters

Headers do four jobs at once, and only one of them is SEO in the narrow sense.

They tell crawlers what each section covers. Google uses heading text to understand the passage beneath it. A clear H2 like “Cost of a programmatic SEO build” ties that section to a query far better than the same words buried in paragraph three.

They make passages easy to lift. Featured snippets are often taken from the paragraph or list directly under a question-shaped H2 or H3. Retrieval systems behind AI Overviews and chat assistants commonly split a page into passages at its headings, so a section with a precise heading and a self-contained answer is easier to quote.

They make the page scannable. Most people read the headings before any body copy. Descriptive headers let a reader find their answer fast, and a page that does that keeps them.

They are accessibility infrastructure. Screen-reader users jump from heading to heading to navigate. A page that skips levels or uses heading tags purely for visual sizing is harder to use with assistive technology.

What Google actually cares about

Google’s John Mueller has said multiple H1s are fine for its systems, and Google’s own SEO Starter Guide says semantic heading order is great for screen readers and does not matter to Google Search. A skipped level will not cost you rankings directly. The rules below exist because the outline has to make sense to people, to screen readers and to any system that quotes a passage out of context. Those are reasons enough.

How to use header tags well

Keep one H1, near the top, that names the page. A second H1 will not get you penalized, and one is still the clearest signal for every reader. Mirror the page’s main intent (see primary keywords) without forcing an exact match.

Map H2s to subtopics and the questions real searchers ask. This is where semantic search pays off. Each H2 should cover a distinct facet of the topic, ideally phrased the way someone would search it. A question-shaped H2 (“How much does X cost?”) followed by a tight answer is the format snippets and AI answers quote most easily.

Write headers for humans first. Concise, descriptive, accurate. A header that overpromises the section below it erodes trust. Skip keyword density games: “Best Best Cheap Accounting Software Cheap” is keyword stuffing, and it reads as low quality to users and to ranking systems.

Make the heading map deliberate at the site level. On large builds we treat header structure as part of SEO site structure: consistent H2 patterns across a template, headers that mirror the query clusters a page targets, and no two pages sharing an identical H1. That consistency is what makes programmatic pages legible at scale, which is the core of our programmatic SEO work.

Use CSS for looks, headings for structure. If a heading is too big, restyle it. Demoting it to an H4 to shrink it, or promoting body text to an H2 to enlarge it, breaks the outline. The semantic tag and the visual size are independent decisions.

Keep headings in the HTML. Headings that only appear after JavaScript runs, or that are images of text, may never reach a crawler’s first pass. See JavaScript SEO for how to check what the server actually sends.

A correct nesting example

<h1>Programmatic SEO: Build Pages at Scale</h1>
  <h2>What programmatic SEO is</h2>
  <h2>When it works (and when it doesn't)</h2>
    <h3>Good-fit data sources</h3>
    <h3>Intent signals to validate first</h3>
  <h2>How we build a pSEO system</h2>
    <h3>Template design</h3>
      <h4>Header map per template</h4>
    <h3>Quality gates</h3>

Read the indentation as the outline. Every level descends by one, every H3 has a parent H2, and the H4 sits cleanly under its H3. That is the entire discipline.

To check a live page, open your browser’s developer tools and search the Elements panel for <h2, or run Lighthouse: its accessibility audit flags headings that are not in sequentially descending order.

When header structure becomes a business problem

A messy outline on one blog post is a ten-minute fix. Under a few hundred pages, a free crawler that lists headings per URL covers the whole site in an afternoon.

It costs money when the structure is wrong in a template, because then it is wrong everywhere at once. A theme renders widget titles in the sidebar as H2s on every page. A product template has no H2s, so 3,000 pages read as one flat block. A page builder lets editors pick heading levels by size. A redesign or migration drops the heading markup from a whole page type. Audits report each one as hundreds of identical warnings.

On a fractional SEO engagement, the two founders fix the template once and verify it held on every URL. Template work is how Gyfted reached 126,824 Google clicks in its best month.

Frequently Asked Questions

What is the correct SEO header structure?

One H1 naming the page, H2s for each major section, H3s for subsections inside an H2, and H4 to H6 only on dense pages that need them. Descend one level at a time, word each heading so it describes the passage below it, and keep every heading in the HTML as real text.

How many H1 tags should a page have?

One is the best practice. Google has said multiple H1s do not cause problems for its systems, but a single H1 is the clearest signal for readers and screen readers. The H1 tag entry covers why the old HTML5 case for several H1s no longer holds.

Do header tags affect Google rankings?

Modestly. Google uses headings to understand what each section covers, which helps it match passages to queries, and well-headed sections are easier to pull into featured snippets and AI answers. Rewording a heading will rarely move a ranking on its own.

Is it bad to skip header levels, like H2 to H4?

When descending, yes, though the cost is mostly for people. Google says heading order does not matter to its search systems. Screen-reader users lose the logical outline, and accessibility checkers such as Lighthouse flag it. Descend one level at a time (H2, then H3, then H4). Jumping back up, from an H4 to the next H2, is fine.

What’s the difference between an H1 and the other header tags?

The H1 names the entire page; H2 through H6 divide that page into a nested hierarchy of sections and subsections. Because the H1 is also the page’s main promise to the reader, it has its own best practices in our H1 tag entry.

Should keywords go in header tags?

Where they fit naturally, yes. Use the terms a reader would use for that section in your H1, H2s and H3s, once each. Clarity beats exact-match repetition: a header that misleads about its section does more harm than any keyword does good.

where we come in

Headings broken on every page that shares a template?

Senior SEO without hiring a team: the two founders run strategy and execution for a fixed monthly fee, one client per vertical.

127k

Gyfted: Google clicks in the best month (GSC, Jan 2024)

read the case study →

  • Not sure yet? The free AI SEO audit is a founder-reviewed snapshot of your site, no obligation.

or ask a founder

30 min · intro, founder-to-founder

Book a call