Skip to the page
html reference · text

HTML <h1> – <h6> tags

closing tag
required
void element
no
lives inside
<body>
typically holds
a short line of heading text

Where it goes

Wherever a new section starts. Keep them in order: one <h1> for the page, <h2> for its sections, <h3> for parts inside those. Do not skip a level just to get a smaller size. Size is a job for CSS.

Example

<h1>Page Title</h1>
<h2>A Section</h2>
<h3>A Subsection</h3>

Open this example in the editor →

Common mistakes

  • Using more than one <h1> on a page, or picking a heading for its size instead of its place in the outline.
  • Jumping from <h1> straight to <h4>. That breaks the outline for anyone moving through the page by heading.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.