Testing

The h1, h2 and h3 tags: read a page's heading outline and fix the real errors

6 min read
Mikhail ShaymardanovWeb Quality and Accessibility Expert

A business owner warned about “multiple H1s” goes looking for the right number of headings, and Google says there isn't one. The h1 tag marks a page's main heading, h2 and h3 its subheadings, and together they form the outline that screen reader users follow. The real errors break that outline: a subheading that is only bold text, or a level that files a heading under the wrong section.

From the page outline to a verdict, heading by heading


#What are h1, h2 and h3 tags used for?

The h1 to h6 tags are HTML elements that mark a page's headings and their rank. The h1 carries the main heading, an h2 opens a section, and an h3 opens a subsection of that h2. Together, they draw the outline of the page.

Above all, the outline serves people who use a screen reader, the software that reads the screen aloud. They jump from heading to heading to find a passage. In the eleventh survey by WebAIM, a nonprofit at Utah State University, 67.8% of screen reader users surveyed start this way to find information on a long page.

With NVDA, a free screen reader for Windows, H moves to the next heading. The number keys 1 to 9 move to the next heading of the matching level, according to its user guide. At each stop, the screen reader announces the heading and its level, or plays a beep or another sound. Text that is only enlarged and set in bold stays a paragraph, so H never stops on it.

Our demo is the home page of Welt & Tack, a furniture upholsterer in Galway. There, H runs through the headings and skips “Hours and directions,” even though it's set in large type. Anyone who jumps by headings never finds the workshop's opening hours.

Click the demo, then press the key shown, or move on with “Next step”. Escape leaves the demo.
4 steps

On the Welt & Tack home page, 2 goes to “Our services,” then H moves through three level 4 headings and never stops on “Hours and directions,” which is set in bold.
NVDA screen reader: how to install it, set it up and test a web page

#How do you check a page's heading hierarchy?

The HeadingsMap browser extension, for Chrome, Firefox and Edge, lists a page's headings with their levels. It indents them like a table of contents and flags breaks in the hierarchy. Clicking a line takes you to that passage.

Install it, open the page, then click its icon. In Chrome, it sits in the Extensions menu. The panel opens on the left. On the Welt & Tack home page, we read the list in three passes.

  1. The level 1 headings, at the top. There are two: “Welt & Tack,” the site name, and the page's own heading. That's where the “multiple H1s” alert comes from. The extension colors neither line.
  2. Where each heading is filed. HeadingsMap colors “Armchair reupholstery” red, a level 4 placed right under a level 2. The “Customer reviews” line gets no color, even though its level 4 files it inside “Our services,” as if it were a third service.
  3. The page next to the list. Every visible subheading should have its own line. Here, six lines cover seven headings on screen: “Hours and directions” has no line.

The list shows real headings only, so a bold subheading gives itself away by the line that's missing. Scan the page by eye, with the panel open beside it.

Screenshot: on the left, the HeadingsMap panel open on its Headings tab; on the right, the Welt & Tack page at “Hours and directions.” The panel lists six headings: two at level 1, “Our services” at level 2, then “Armchair reupholstery” on a red band, “Made-to-measure curtains” and “Customer reviews” at level 4.Marker 1. The two level 1 lines, “Welt & Tack” and “Armchairs and chairs reupholstered by hand in Galway”. Marker 2. The “Armchair reupholstery” line, colored red. Marker 3. The “Customer reviews” line, at level 4 under “Our services”. Marker 4. The “Hours and directions” heading on the page, with no line in the panel.
On the Welt & Tack home page, HeadingsMap lists six headings, two of them at level 1marker 1 and “Armchair reupholstery” in redmarker 2. The “Customer reviews” linemarker 3 lands at level 4 inside “Our services,” and the “Hours and directions” headingmarker 4 has no line at all.

#Multiple h1 tags on one page: what needs fixing?

Multiple h1 tags on a page can wait: the headings that break the outline come first. Google's SEO starter guide says plainly that no number of headings is ideal. The HTML standard also allows more than one h1. Four rules tell errors from recommendations:

  • Error: text that works as a heading without being marked up as one, so the H key skips it. WCAG, the international accessibility guidelines, counts it as a failure of its success criterion 1.3.1, Info and Relationships. In Europe, the standard EN 301 549 requires that criterion on every web page. It was written as one voluntary way to meet the European Accessibility Act.
  • Error: a level that files a heading under a section it doesn't belong to. The level tells where the heading belongs. Text size is set separately, in the style sheet.
  • Recommendation: a single h1 that describes the page's content. MDN, the reference documentation for web developers, advises it without forbidding more than one.
  • Recommendation: no skipped level on the way down, like an h4 right under an h2. The W3C, which writes the web's standards, advises avoiding it where possible. Deque's testing engine, axe-core, lists heading order among its best practices, apart from the rules it ties to WCAG. On the way back up, an h2 can follow an h4, since the h2 closes the subsection.

#Which headings should you fix, and which can wait?

On the Welt & Tack home page, these four rules give two fixes and two recommendations. The page's own heading and “Our services” are already right.

To fix: “Hours and directions” and “Customer reviews” break the Welt & Tack outline and move to level 2.
HeadingTodayFix
“Hours and directions”bold text, missing from the listlevel 2 heading
“Customer reviews”level 4, filed inside “Our services”level 2
Recommendations only: the theme's h1 and the two level 4 cards can wait.
HeadingTodayNext step
“Welt & Tack”extra h1, added by the themereport it to the developer
“Armchair reupholstery”
“Made-to-measure curtains”
level 4 right under a level 2level 3 at the next edit

The same level 4 therefore gets two verdicts. The two cards belong to “Our services,” and their skipped level can wait, even though HeadingsMap colors the first one red. “Customer reviews” doesn't, so the outline is wrong at that point, yet nothing colors that line. A level is judged by the section it files the heading under, never by its number alone.

Heading levels matter to screen reader users. In WebAIM's eleventh survey, 88.3% of respondents find heading levels very or somewhat useful when they navigate by headings.

#How do you change a heading level in WordPress or Wix?

In WordPress, you set a Heading block's level with the Transform button on its toolbar, or with the H1 to H6 buttons in its block settings. The same Transform button turns a Paragraph block into a Heading block. Font size has its own setting, under Typography in the block settings. In Wix, select the text, click Edit Text, then SEO & accessibility, and pick the tag from the Choose HTML tag drop-down. This changes the tag without touching the content or the design.

#What about the h1 added by the theme?

An h1 written by the theme, the site's design template, sits outside the page you edit, so report it to the developer. On the demo, that's “Welt & Tack,” the only heading the page editor doesn't show. The “multiple H1s” alert was aimed at that heading. The WordPress theme Twenty Twenty-One does the same with the site name on the home page.

The two real errors, “Hours and directions” and “Customer reviews,” came from the page editor. The fix happens there too and changes nothing on screen. Our screenshots of the two versions match pixel for pixel. Moving the page's own heading down to level 2 to silence the alert would be the wrong move. The only h1 left would be the workshop's name, while MDN says the h1 should describe the page's content.

Avoid

Screenshot: the HeadingsMap panel on the original page, with six lines, including “Customer reviews” at level 4 under “Our services”; on the right, the page's “Hours and directions” heading.Marker 1. The “Customer reviews” line, at level 4. Marker 2. The “Hours and directions” heading on the page, with no line in the panel.

Correct

Screenshot: the HeadingsMap panel on the fixed page, with seven lines, including “Hours and directions” and “Customer reviews” at level 2, and both h1 headings still at the top; on the right, the page looks the same.Marker 1. The “Hours and directions” and “Customer reviews” lines, at level 2. Marker 2. The “Hours and directions” heading on the page, unchanged.
Before, “Customer reviews”marker 1 falls to level 4 inside “Our services,” and “Hours and directions”marker 2 has no line. After, both move to level 2marker 1, the pagemarker 2 looks the same, and the two h1 headings stay at the top.

After the fix, the list has seven lines, one more than before, still with two h1 headings. The outline finally says what the screen shows. With NVDA, H now stops on “Hours and directions,” and 2 also reaches “Customer reviews.”

EN 301 549 v4.1.1: what the new version changes for your website

On a live site, the manual tests in Includdy give headings a category of their own and suggest a verdict for each, which you accept or change.


Share this article

Frequently asked questions

Yes. Deque's automated testing engine, axe-core, lists a missing level-one heading among its best practices, apart from the rules it ties to WCAG.

The HTML standard still recommends at least one level 1 heading once a page has headings. Yoast SEO's Premium analysis shows a red bullet when the h1 is missing. The simplest choice remains an h1 that says what the page is about.

The title tag gives the document's title, the one shown in the browser tab or title bar. The h1 is the main heading of the page's content.

According to MDN, a page should generally have a single h1 that describes its content, much like the title element. Our glossary has its own entry on the page title.

No official one. WCAG sets no length for headings: it asks that they describe their topic.

The W3C even points out that a heading doesn't need to be long, and that a single word can be enough if it helps people find the content. The “ideal” lengths quoted on SEO blogs don't come from WCAG. An h1 that says in a few words what the page contains does the job.