Use H2 headings for the main sections under a page’s H1 and H3 headings for subsections within an H2. When a new section is a peer of the previous H2, return to H2. Set the visual size with CSS so the heading level can describe the page structure.
On this page
On a library page about borrowing a sewing kit, “Choose a kit” and “Return your kit” describe two separate tasks. They belong at the same heading level. “Hand sewing kit” and “Machine sewing kit” belong one level deeper because they explain the choices within the first task.
Use the peer-or-child test
Start with an H1 that names the page. List the main sections underneath it. Give each of those sections an H2. If an H2 contains distinct pieces that readers would benefit from finding directly, give those pieces H3s.
| What the line does | Markup | Example |
|---|---|---|
| Starts a main section under the page heading | H2 | Choose a kit |
| Starts a subsection within that H2 | H3 | Hand sewing kit |
| Emphasizes a sentence within the current section | Paragraph with emphasis | Bring your library card. |
Ask where the new heading would sit in a contents list. If it belongs beside the last H2, make it another H2. If the section explains one part of the last H2, make it an H3. A section with a short paragraph can stand on its own without a subsection.
Repair the heading order on a service page
Here is the heading markup from a fictional library page. Imagine the editor chose H4 for the kit names because that preset looked smaller.
<h1>Borrow a sewing kit</h1>
<h2>Choose a kit</h2>
<h4>Hand sewing kit</h4>
<h4>Machine sewing kit</h4>
<h3>Return your kit</h3>
The jump from H2 to H4 skips H3, the level that would mark each kit as a direct subsection of “Choose a kit.” “Return your kit” has a different problem. An H3 places it under “Choose a kit,” but someone looking for return instructions should be able to find it as a separate section.
<h1>Borrow a sewing kit</h1>
<h2>Choose a kit</h2>
<h3>Hand sewing kit</h3>
<h3>Machine sewing kit</h3>
<h2>Return your kit</h2>
The final H2 closes the previous subsection and starts a new section. A jump back to a shallower level can be appropriate. If “Machine sewing kit” had an H4 explaining compatible needles, “Return your kit” could still follow as an H2.
Use CSS or a style setting to keep the kit labels at the size that suits the design. The HTML level still communicates their place in the page.
Check the published page
- Read just the main content headings in order. Check that each names the content that follows and that the list shows where one task ends and another begins.
- Inspect the rendered HTML to confirm the tags your site builder emits. Then check the browser’s accessibility tree to verify that the headings are exposed at the intended levels.
- Check shared areas such as the sidebar separately. A reusable navigation block can keep a consistent heading rank across pages even as the main content changes.
Assistive technology can expose headings as navigation stops, so a useful outline gives readers a way to move between sections. Google’s SEO Starter Guide says Google Search does not require headings in semantic order and has no ideal heading count. Choose levels for the structure readers need.
If you are also deciding what belongs in the browser tab or the page’s main heading, see the title tag and H1 guide. When the outline is sound and the sections still take too long to reach their point, use the answer-first writing guide.
Sources & further reading
Primary references checked Nov 10, 2026. Platform guidance can change.
AI-assisted research and writing. Learn about our editorial standards.
Suggest a correction ↗



