Free HTML tutorial

HTML Headings: Structure Content with h1 to h6

Learn how to use HTML heading elements h1 to h6 to organize content into a clear, meaningful outline.

Use headings to organize content

HTML provides six heading levels, from <h1> for the main page heading through <h6> for the least prominent level. Choose a heading to reflect its place in the content outline.

<h1>Gardening basics</h1>
  <h2>Choosing a location</h2>
  <h2>Preparing the soil</h2>
    <h3>Testing drainage</h3>

Keep the outline understandable

Use headings for section titles, not simply to make text look large or bold. Use CSS to change appearance while keeping the heading level that best describes the content.

A page usually has one main <h1>. Organize following sections with <h2> and subsections with <h3>. Avoid skipping levels when a section is nested under another heading.

Open the heading example (opens in a new tab)