The heading hierarchy: H1 to H6 for humans and machines
Why heading structure matters
HTML headings (H1 to H6) are more than formatting. They represent the hierarchical structure of your content and tell search engines, screen readers and AI models how your information is organized. A correct heading hierarchy is like a table of contents: it shows at a glance what the page covers and how the sections relate to each other.
For AI models, headings are particularly valuable. When a language model processes a long page, it uses headings to segment the text and identify core topics. A page with clear, descriptive headings is better understood and more accurately cited than a page consisting of a continuous block of text.
Heading structure is closely connected to the readability of your content. Together with Schema.org markup, they form the triangle of machine readability that determines how well AI models can process your page.
The rules of heading hierarchy
The heading hierarchy follows a logical tree structure. Each page starts with an H1 as the main title, followed by H2 sections that mark the main topics, H3 subsections that elaborate further, and so on. Skipping levels, for example going directly from H2 to H4, disrupts the logical structure.
Good example: logical hierarchy
Below you can see what a well-structured page looks like in HTML. Notice how each heading level logically falls under the previous one, like a nested table of contents.
<h1>AEO strategy for e-commerce websites</h1>
<h2>Why AEO is essential for online stores</h2>
<p>Explanation of the importance of AI visibility...</p>
<h2>Technical optimization</h2>
<h3>Schema.org Product markup</h3>
<p>Implementation of product structured data...</p>
<h3>Review and rating schema</h3>
<p>How to make reviews visible to AI...</p>
<h2>Content strategy</h2>
<h3>Optimizing product descriptions</h3>
<p>Tips for AI-friendly product copy...</p>
<h4>Structuring specifications</h4>
<p>The importance of structured specs...</p>
<h3>Leveraging FAQ pages</h3>
<p>How FAQ content contributes to AEO...</p>
<h2>Measuring results</h2>
<p>KPIs and tools for AEO success...</p>Bad example: broken hierarchy
Compare the above with a page where the heading hierarchy is broken. This is unfortunately a common pattern that confuses AI models.
<!-- WRONG: multiple H1 tags -->
<h1>AEO strategy</h1>
<h1>For e-commerce websites</h1>
<!-- WRONG: H4 directly after H2, H3 skipped -->
<h2>Technical optimization</h2>
<h4>Schema.org Product markup</h4>
<!-- WRONG: heading used for styling, not structure -->
<h3><strong>NOTE: important!</strong></h3>
<!-- WRONG: inverted hierarchy -->
<h4>Main topic</h4>
<h2>Detail of the main topic</h2>
<!-- WRONG: empty heading -->
<h2></h2>Dive deeper: Content readability and Flesch scores | Schema.org markup for AI | E-E-A-T optimization
The H1: one per page
The H1 is the main title of your page and should appear only once. This is one of the most consistent recommendations in both SEO and AEO. The H1 tells search engines and AI models in one sentence what the page is about. Make the H1 descriptive, unique compared to other pages and relevant to the content.
- Use exactly one H1 per page. Not two, not zero.
- The H1 should describe the primary topic of the page.
- Keep the H1 between 20 and 70 characters for optimal display and interpretation.
- Avoid generic H1 titles like "Welcome" or "Home". Be specific.
- The H1 does not need to be identical to the title tag, but should be consistent in topic.
H1 and AI citations
AI models use the H1 as the primary indicator of the page topic. When a model generates an answer and selects sources, the H1 plays a major role in determining whether your page is relevant to the query. An H1 like "Everything about Schema.org markup for webshops" is much more powerful than "Our blog" for matching with related queries.
H2 and H3: the workhorses of your structure
H2 headings mark the main sections of your page. They are comparable to the chapters of a book. Use 4 to 8 H2 headings per page of average length. Each H2 should introduce a clear, defined subtopic.
H3 headings are the subsections within an H2 section. They provide an additional layer of structure that is particularly valuable for longer, more detailed content. Use H3 headings when an H2 section contains multiple clearly distinguishable parts.
Formulate your H2 headings as questions your audience would ask. AI models often match search queries directly to headings. An H2 like "How do you implement Schema.org?" has more AEO value than "Schema.org implementation".
Heading format strategies
There are three common formats for headings, each with their own advantages:
- Question format ("How does Schema.org markup work?"): most effective for AEO because AI models directly match against user queries. Use this for informational content.
- Instructional format ("Implement Schema.org in three steps"): good for tutorials and how-to content. Promises action and results.
- Descriptive format ("Schema.org: the basics"): compact and clear. Good for reference content and documentation.
Choose a consistent format per page. Do not mix question format and descriptive format on the same page, unless there is a clear reason (for example a FAQ section within an informational article).
Headings and accessibility
The heading hierarchy is not only important for SEO and AI. It is a fundamental part of web accessibility. Screen readers use headings to help visually impaired users navigate through a page. A user can quickly jump to the relevant section of the page via headings, similar to how a sighted reader scans a page.
The Web Content Accessibility Guidelines (WCAG) 2.1 state that headings must reflect the structure of the content (guideline 1.3.1). This is not just a recommendation but a legal requirement in many countries. By correctly implementing your heading hierarchy, you simultaneously improve your accessibility, your SEO and your AEO.
Accessibility and AI readability go hand in hand. Just as alt texts for images help both screen readers and AI models, a good heading structure serves both human and machine readers. It is a win-win you should never skip.
Headings and structured data
Your heading structure reinforces the effectiveness of your Schema.org markup. When you use an Article schema, AI models expect the headline in the schema to match the H1 on the page. Inconsistency between these two is a signal of low quality. Make sure your structured data and your heading hierarchy tell the same story.
A well-structured page combines the visual hierarchy (headings) with the semantic hierarchy (Schema.org). The headings tell what the page contains at document level, while Schema.org does so at data level. Together they give AI models a complete picture.
Common mistakes and how to avoid them
- Using headings for styling instead of structure. Use CSS for visual formatting and headings exclusively for content hierarchy.
- Too many heading levels on a page. Most content needs only H1, H2 and H3. Use H4 and deeper only when the complexity of your content justifies it.
- Non-descriptive headings like "More information" or "Details". Every heading should be understandable on its own, even outside the context of the surrounding text.
- Inconsistent heading style: do not mix between question form and statement within the same page. Choose a style and stick with it.
- Hidden headings for SEO: headings that are invisible to users but visible to search engines violate guidelines and are ignored or penalized.
An audit checklist for heading structure
- Does the page have exactly one H1?
- Does the H1 accurately describe the main topic?
- Do the headings follow a logical hierarchy without skipped levels?
- Are all headings descriptive and understandable out of context?
- Is the heading format (question, instruction, description) used consistently?
- Are there no empty headings or headings used only for styling?
- Does the heading structure match the Article.headline in your Schema.org markup?
- Are the headings informative enough to serve as a table of contents?
Checking heading structure
Our AEO scanner automatically checks your heading hierarchy for the most common errors: missing H1, multiple H1 tags, skipped levels and empty headings. Additionally, you can manually check heading structure with browser developer tools or extensions like HeadingsMap for Chrome.
Make it a habit to check the heading structure before you publish content. Just as you would provide a document with a table of contents before distributing it, your web page deserves a logical heading structure before you send it out into the world.
Key takeaways
- Headings (H1 to H6) are the structural backbone of your page and tell search engines, screen readers and AI models how your content is organized.
- Use exactly one H1 per page as the main title, followed by H2 sections and where necessary H3 subsections in a logical tree structure.
- Formulate headings descriptively and preferably as questions for maximum AEO value, so AI models can directly match them to user queries.
- Heading structure, Schema.org markup and readability reinforce each other: optimize them as a whole for the best results.
- Check your heading hierarchy structurally before publication, just as you check a table of contents before distributing a document.
Frequently asked questions
Can I use multiple H1 tags on a page?
The HTML5 specification technically allows multiple H1 tags within different sectioning elements. In practice, both Google and most AEO experts recommend using only one H1 per page. This is clearer for search engines, AI models and screen readers. Once per page, clear and descriptive.
How deep should my heading hierarchy go?
For most content, H1, H2 and H3 are sufficient. Use H4 only for very detailed, technical content. H5 and H6 are rarely needed on web pages. If you find yourself using H5 or H6, consider whether the page might be better split into multiple pages.
Should my H1 contain the primary keyword?
It is wise to include your primary keyword in the H1, but don't force it. The H1 should first and foremost be descriptive and natural. A heading like "AEO strategy for e-commerce" is better than "AEO strategy e-commerce optimization SEO tips". This principle applies equally to E-E-A-T optimization: naturalness and relevance outweigh keyword density.
How do I handle headings in sidebar and footer?
Headings in sidebars and footers should not interfere with the heading hierarchy of your main content. Use the HTML5 aside element for sidebars and the footer element for footers. If you do use headings in these sections, choose a lower level (H3 or H4) that does not disrupt the hierarchy of the main content.
Does the heading level count towards the AEO score?
Yes. Our AEO scanner checks the heading hierarchy and weighs it as part of the total score. Specifically, it checks for: presence of exactly one H1, logical order of heading levels, descriptive heading text and absence of empty headings. A correct hierarchy directly contributes to your AEO score.
Headings are the signposts of your content. Without them, both readers and machines get lost in a sea of text.
How does your website score on AI readiness?
Get your AEO score within 30 seconds and discover what you can improve.