1001Ferramentas
📋Validators

Heading Hierarchy Validator

Validate the heading hierarchy (H1 to H6) of a page and find out if it skips levels. Improve the accessibility, structure and SEO of your HTML content.

Resultado

—

Skipping from H2 to H4 hurts

Screen reader users move through headings the way sighted readers skim a page: press H, next heading, next. When a document jumps from H2 straight to H4, they cannot tell whether a section went missing along the way. Audits report this as heading-order, and the cause is usually the same: someone picked the level by how big the text looked instead of where it sits in the structure.

One thing to know before you start: this does not take HTML. You type the sequence of levels in the order they appear, something like 1,2,2,3,4,2,3, and the check runs over those numbers. It flags three situations: jumping down by more than one level, having no H1 at all, and having more than one H1. Climbing back up several levels at once, H4 to H2 for a new section, is normal and is not flagged.

To collect the sequence, the quick route is the console: run document.querySelectorAll('h1,h2,h3,h4,h5,h6') and read the tags in order. Two caveats. Numbers outside the 1 to 6 range are dropped silently, so a stray 7 vanishes from the check instead of raising an error. And the single H1 rule is settled best practice, not a formal WCAG requirement, so a page with an H1 in the banner and another in the content deserves a judgement call.

Frequently asked questions

Does skipping from H2 to H4 fail WCAG?
Not as a direct success criterion failure. It is treated as best practice and flagged by tools such as axe, because out of order headings make list-of-headings navigation harder to follow.
Can a page have more than one H1?
HTML allows it and screen readers cope. Even so, the safer convention is a single H1 describing the main subject. The check here follows that convention and reports the second H1.
Can I paste my HTML in here?
No. The input is a comma separated sequence of levels, such as 1,2,3,3,2. Pasting HTML yields an empty result, because the tags never turn into numbers.

Related Tools