SEO blog · On-page SEO

Heading Structure H1–H6: An SEO and Accessibility Guide

Key takeaways

  • Heading structure is the outline of a page: one H1 that names the topic, H2s for main sections, H3s for subsections, and no skipped levels.
  • Choose a heading by its role, not its font size. CSS controls how it looks; the HTML tag controls what it means.
  • One H1 per page is the practical recommendation from MDN and accessibility guidance, although extra H1s are not a technical error.
  • Screen readers can list a page's headings, so a logical hierarchy directly helps users with visual impairments and indirectly helps search engines and AI systems.

Heading structure H1–H6 means using HTML heading tags as the table of contents of a page: a single H1 that names the topic, H2s for the main sections, H3s for subsections, no skipped levels, and no headings added just because they look good. Readers, screen readers, Google, and AI systems all use the same hierarchy to figure out what a page is about.

In practice, most problems do not come from missing headings. They come from headings placed at random: WordPress themes that turn “Recent posts” into an H2, H3s chosen because they “look smaller,” two H1s on one page. Heading structure is one of the cheapest parts of on-page SEO because it costs no budget, only attention to your templates. This guide shows what a correct structure looks like, how to check it in two minutes, and what you can safely ignore.

What are H1–H6 tags and what do they do?

A heading is an HTML element that marks the start of a section and gives it a name. There are six levels: <h1> is the most important and <h6> the least. The level does not say how large the text appears. It says where the heading sits in the hierarchy. Size is set by CSS and can change at any time without touching the structure.

Think of a book. The book title is the H1, chapters are H2s, sections within chapters are H3s. Nobody places a level-3 section directly under the book title with no chapter in between. A web page works the same way.

Headings have three audiences, and all of them matter:

  • Readers skim, read the headings, and decide where to stop. On a phone, skimming is nearly the only way people read.
  • Assistive technology (screen readers) can show a list of the page's headings and jump from one to the next. For a blind user, the hierarchy is the map of the page.
  • Machines, meaning search engines and AI models, split text into passages by heading and use a section's heading as a label for what follows.

This is different from the title that appears in search results. The <title> element in the <head> shows up in results and in the browser tab; we cover how to write it in the guide to title tags and meta descriptions. The H1 is the visible headline inside the page, and the two can differ.

How many H1 tags should a page have?

The practical recommendation is one H1 per page, expressing the main topic. MDN says that more than one H1 is allowed by the HTML standard but is not considered a best practice, and advises using a single H1 and not skipping heading levels. The W3C accessibility guidance describes the same simple structure: one main heading with sections underneath.

Multiple H1s are not a fatal error, though. HTML does not prohibit them, and Google representatives have said publicly that several H1s on a page are not a problem in themselves. The real issue is clarity: with two main headings, it is no longer obvious what the page is about, and a screen reader lists two unrelated “roots.”

Where do extra H1s usually come from?

  1. The theme puts the site name in an H1 in the header, and the article has its own H1.
  2. A home page banner has a slogan marked as H1, followed by another primary heading.
  3. A page builder uses H1 for every “big heading.”

Check the template once rather than every page. If the header and banners in the template are right, the whole site is fixed at once.

About “sections with their own H1”: early HTML5 described an outline algorithm in which each <section> could have its own H1, with the real level inferred from nesting. Browsers and screen readers never implemented it, and the current specification recommends relying on the explicit heading level. So do not depend on it.

How do you build the hierarchy step by step?

The simplest way is to write the skeleton before the text. A good skeleton reads on its own like a table of contents.

  1. Write the H1. State the page topic in words your reader would use. For a guide, the H1 usually contains the main keyword; for a product page, the product name.
  2. List the major sections. Each becomes an H2. If you need ten H2s on a 600-word page you have too many; if you have one H2 in 2,000 words you have too few.
  3. Split long H2 sections. A section over 300–400 words usually contains sub-topics. Each sub-topic becomes an H3 under the right H2.
  4. Go down to H4 only when needed. For most articles, H2 and H3 are enough. H4–H6 show up in long technical documentation, not in commercial pages.
  5. Do not skip levels. An H2 can be followed by an H3, not an H4. You can jump back up as far as you like (H4 back to H2), but never down two steps at once.
  6. Read only the headings. If someone reads just the list of headings, they should understand the route through the page. If not, rewrite them.

Here is a correct skeleton for a dental services page:

<h1>Dental Implants in Bucharest</h1>
  <h2>How a dental implant procedure works</h2>
    <h3>Consultation and X-ray</h3>
    <h3>The procedure</h3>
    <h3>Healing period</h3>
  <h2>How much an implant costs</h2>
  <h2>Who is not a candidate for an implant</h2>
  <h2>Frequently asked questions</h2>

Notice that each H3 answers “what does this mean in detail?” for the H2 above it, and the H2s are parallel, sitting at the same level of generality.

Good headings vs. weak headings

A good heading is specific, makes sense without context, and announces the content. A weak heading is vague, decorative, or repeats the keyword for no reason.

Weak headingWhy it failsBetter version
DetailsSays nothing about the sectionWhat the package includes and what it does not
About us, our services, pricingThree topics in one headingThree separate headings, or one topic
SEO services cheap SEO servicesRepetition for machines, unreadable for humansHow to choose an SEO service at a fair price
Welcome!Does not describe the pageA service name or a clear value proposition
Step 3Meaningless outside the listStep 3: Add alt attributes to images

A useful trick is to phrase some H2s as real questions: “How many H1s should a page have?” or “When does this not apply?” Readers who typed the question into Google recognize themselves in the heading, and an extraction system can find the question–answer pair easily. Do not turn every heading into a question, though; a natural mix reads better.

Headings and accessibility

Accessibility is not a separate chapter from SEO. It is another way of checking the same structure. The WCAG guidelines require that information and relationships conveyed visually can also be determined in code (the “Info and Relationships” criterion), and that headings and labels describe their topic or purpose (“Headings and Labels”). A heading built from a bold <div> looks right but tells assistive technology nothing.

How a screen reader uses headings:

  • it lists all headings on the page with their levels;
  • it lets the user jump to the next heading, or the next heading of a given level;
  • it announces the level when it reaches a heading.

If the hierarchy jumps from H2 to H5 or headings are missing, users lose their bearings. If “Recent posts” in the sidebar is an H2, just like the article's sections, a screen reader user assumes they have moved into a new section of the content.

Three accessibility rules that also help SEO:

  1. Headings describe the content that follows. They do not just decorate it.
  2. Never leave empty headings (for example, an <h3></h3> left behind by an editor).
  3. Repeated template elements (menus, widgets) should not be marked up with high-level headings unless they are genuine sections of the page.

How do headings relate to SEO and AI answers?

Google does not publish a rule such as “use five H2s and four H3s.” Its documentation asks instead for helpful, easy-to-navigate content written for people, and headings are one of the simplest ways to make content easy to navigate. Google's SEO Starter Guide points in the same direction: logically organized pages with clear text.

What can be said with reasonable confidence:

  • Headings provide context. A paragraph under “How much an implant costs” is understood in that context; the same paragraph with no heading can be ambiguous.
  • Structure helps break text into passages. Retrieval systems, including those behind AI-generated answers, often work with chunks of text. A section with a clear heading and a direct answer at the top is easier to cite than a wall of text. There is no guarantee, only logic.
  • Words in headings are visible. They naturally highlight your important terms, but you cannot “trick” the hierarchy with H2s stuffed with keywords.

If you also want a page to show up in AI answers, use an “answer under the heading” rule: the first sentence below an H2 answers what the heading promises, and the explanation follows. We cover the broader mechanism in the guide to becoming a cited source in Google AI Overviews.

Heading structure works together with the page title, meta description, images, and internal links. If a page does not match the search intent, a perfect heading order will not save it, which is why the article on search intent is worth reading too.

A checklist for heading structure

Use this table as a checklist for each important page type.

CheckCriterionHow to do it
Single H1Exactly one H1 in the main contentHeading list from DevTools or an extension
Relevant H1Describes the page topic, not the brandRead the H1 without seeing the rest of the page
No skipsH2 → H3 → H4, no steps skippedWalk through the heading list
No empty headingsEvery heading has visible textFilter in an analysis tool
Unique headingsNo repeated H2 textCompare the list
Clean templateWidgets are not content H2/H3sCheck header, sidebar, footer
LengthMost headings 4–10 wordsVisual scan
KeywordsAppear naturally in H1 and 2–3 H2sRead it; do not count

How to check your structure in two minutes

You do not need a special tool to list a page's headings. Open DevTools (F12), go to the Console tab, and run:

document.querySelectorAll('h1,h2,h3,h4,h5,h6').forEach(h => {
  const level = Number(h.tagName[1]);
  console.log('  '.repeat(level - 1) + h.tagName + ': ' + h.textContent.trim());
});

The output is an indented outline of the page. Look for three things: more than one H1, skipped levels, and headings that do not belong to the content (such as “Subscribe” or “Popular posts”). For drafts still in progress, our SEO content analyzer also checks the heading structure alongside keyword density and readability. Remember that JavaScript can add headings after load; if your hierarchy depends on code that runs in the browser, see JavaScript SEO.

Common mistakes

  • Headings chosen for font size. When you want smaller text, use CSS, not an H5. This is the most common mistake, especially in page builders.
  • The brand or logo as the H1 on every page. Every page has its own topic and its own H1.
  • H2s in widgets. “Most read articles,” “Newsletter,” and “Follow us” are not content sections. Change them to <p> or another non-heading element.
  • Jumping from H2 to H4. It happens when someone wants “a smaller heading.” Fix it.
  • Keyword-only headings. An H2 like “Keyword cheap Bucharest top” hurts readability and, at best, gains nothing.
  • Headings longer than two lines on mobile. If you need a long explanation, put it in the paragraph below the heading.
  • Headings that promise something the section does not deliver. They disappoint readers and send a poor quality signal.
  • Text hidden for bots only. An H1 hidden with CSS that differs from what the user sees should be avoided; whatever matters has to be visible and useful to a person.
  • Headings inside images. Important text drawn in an image is not a heading for anyone who cannot see the image.

When this does not apply, and the limits

Heading structure is a tool, not a magic factor. A few limits, stated honestly:

  • It does not make up for weak content. A page with perfect headings and shallow text will not beat one with useful text and slightly imperfect headings.
  • Google does not promise a measurable effect. There is no number like “fixing the H1 brings X% more traffic.” The main benefit is clarity, and the effect in search results is, at best, indirect.
  • Very short pages do not need a deep hierarchy. A contact page can have an H1 and two H2s, with no H3.
  • Web apps and dynamically generated pages may have special rules; there, the accessibility guidance for the interface comes first.
  • Long legal or technical documents can justifiably use H4–H6 with numbering without it being a problem.
  • Other formats (PDFs, forms) have their own structural rules.

If you must choose between “perfectly structured” and “useful,” choose useful. With a little care, you can have both.

Conclusion and next steps

Headings H1–H6 are the cheapest form of page organization: free, fixable in an afternoon, and useful to people, accessibility tools, and search engines at once. The core rule is simple: one H1, H2s for sections, H3s for subsections, no skipped levels, and no tag used only for its looks.

What you can do today:

  1. Run the script above on the five most important pages of your site.
  2. Fix duplicate H1s and H2-marked widgets in the template.
  3. Rewrite vague headings (“Details,” “Information”) so they announce the content.
  4. Connect the corrected pages with descriptive anchors; the guide to internal linking and site architecture shows how.

If your site has hundreds of pages and several templates, a manual check gets long. In that case, a team that does on-page SEO can audit the structure by page type and hand developers clear specifications. For the big picture, start with Google Search Console, see which pages get impressions, and fix the structure of those pages first.

Sources and further reading

Frequently asked questions

Frequently asked questions

Can a page have more than one H1?

Technically yes, since HTML does not forbid it. The practical advice is still one H1 per page, because a single clear main heading simplifies the outline for screen readers and for anyone analyzing the page. If your theme prints two H1s, fix one of them.

Does the font size of a heading matter to Google?

Not the way people assume. Meaning comes from the HTML tag, not the look. An H2 styled small is still an H2, and a paragraph styled large is still a paragraph. Use CSS for appearance and heading tags only for their structural role.

Should every heading include the keyword?

No. Repeating it in every H2 sounds unnatural and gains nothing. Put the keyword or a natural variation in the H1 and in two or three section headings where it fits, and write the rest to describe what each section actually says.

Can the logo or site name be the H1?

Usually not. The H1 describes the current page, not the brand. A home page sometimes uses the company name as its H1, but on articles and service pages the H1 should be that page's title, and the logo should simply be a link.

How long should H2 and H3 headings be?

Long enough to make sense on their own, typically four to ten words. A good heading tells readers what they get in that section. Avoid vague one-word labels like “Details” and long sentences that take three lines on a phone.

Related service

On-page SEO optimization

See the service →

Let’s grow your site’s organic traffic

Send us your website address and we’ll reply with a free initial analysis and a concrete SEO strategy — no strings attached.