The Six Heading Levels
A free lesson from Swipe Coding · HTML, level 2 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
HTML gives you six levels of heading, <h1> through <h6>, each one marking a title or section header. <h1> is the most important heading on the page and <h6> the least important — browsers shrink the default font size as the number climbs, but the real point of headings is to build a hierarchy, like the outline of a document, not just to make text bigger or bolder.
<h1>Main Title</h1> <h2>Section</h2> <h3>Subsection</h3>
Screen readers let users jump straight from heading to heading to skim a page, and search engines use headings to figure out what a page is actually about. Both depend on the heading levels reflecting real structure, not just how someone wanted the text to look.
Every heading level comes with a default size and weight baked into the browser, but that's just a starting point — real projects almost always override it with CSS. Pick a heading level for what it means in the outline, not for how big or bold it happens to look by default.
<h1 style="font-size: 14px;">Still the main heading</h1>
What is the actual purpose of heading levels like <h1> through <h6>?
The most important heading on a page, typically used once near the top, is ____.
You should choose a heading level based on how big or bold you want the text to appear.
Keep your streak going in Swipe Coding
Swipe through every level of HTML on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →