HTML Headings: <h1> to <h6>
HTML provides six levels of section heading, <h1> (most important) through <h6> (least important). Headings establish your page’s outline and are read by screen readers and search engines as a table of contents — use them in order, and use only one <h1> per page for your main title.
Last updated: October 3, 2026
Quick facts
| Category | Flow content, heading content, palpable content |
| Content model | Phrasing content |
| Tag omission | Neither the start nor end tag can be omitted |
| Permitted parents | Any element that accepts flow content |
| DOM interface | HTMLHeadingElement |
Syntax
Live example
Edit the code below and watch the preview update instantly.
Attributes
| Attribute | Description |
|---|---|
| — | Headings have no attributes of their own — only the global attributes shared by every HTML element. |
Common examples
A clear page outline
Use one <h1> for the page topic, <h2> for main sections and <h3> for their sub-sections — like the chapters and sub-chapters of a book.
Change a heading’s size without changing its level
Choose the level for the structure, then set the size with CSS. A small-looking section title can still be an <h2>.
Headings you can link to
Give a heading an id and you can jump to it from a table of contents or share a link straight to that section.
<h1> vs <title>
They are often confused because both describe what the page is about. The <title> lives in the <head> and appears in the browser tab and as the clickable headline in Google. The <h1> is the main heading visible on the page itself.
Every page should have exactly one title and, as a rule, one <h1>. They usually say similar things, but they don’t have to match: the title can be shorter and include your site name, while the <h1> can be friendlier for people already on the page.
| <h1> | <title> | |
|---|---|---|
| Where it appears | On the page | Browser tab, search results |
| Where it goes | In the <body> | In the <head> |
| How many | Usually one | Exactly one |
Common mistakes to avoid
- Choosing a level by its size. Picking
<h4>because it “looks right” breaks the outline. Choose the level for the structure and change the size with CSS. - Bold paragraphs instead of headings.
<p><b>Pricing</b></p>looks like a heading but screen readers and search engines can’t tell it starts a section. - Using headings for taglines or decoration. A slogan under the logo is not a heading; use a <p> and style it.
- Several
<h1>s fighting for attention. One clear main heading tells everyone what the page is about.
Accessibility & SEO tips
- Screen reader users jump between headings (often with the H key) to skim a page, much like sighted readers scan bold titles — a logical outline makes your page easy to navigate.
- Write descriptive headings that include the words people search for. Search engines use headings to understand a page, and question-style
<h2>s often appear as featured snippets. - Keep the order logical: don’t jump from
<h2>to<h4>, and don’t use an empty heading just to create space.
Browser support
Supported in every browser, including Chrome, Edge, Firefox, Safari and their mobile versions — it has been part of HTML since the very first versions.
Tutorial: How to change the font