HTML Headings

HTML headings are the signposts of your web page. They tell both your users and search engines what your content is about and how it is organized.

In HTML, there are exactly six levels of headings, ranging from <h1> (the most important) down to <h6> (the least important).

The Six Heading Levels

When you use a heading tag, the browser automatically applies some default styling (making the text larger and bolder). However, their true purpose is structure, not style.

TagPurposeTypical Use Case
<h1>The Main TitleThe title of the blog post or the name of the page.
<h2>Major Section HeadingBreaking the main topic into large, distinct sections.
<h3>Subsection HeadingDividing an <h2> section into smaller, specific topics.
<h4>Minor HeadingGrouping granular details under an <h3>.
<h5>Sub-minor HeadingVery specific categorization (rarely used).
<h6>Lowest Level HeadingThe absolute smallest division of content (very rarely used).

Why Headings Matter

Headings do much more than just make text big and bold. They are critical for the underlying health of your website:

Golden Rules of Headings (Best Practices)

To write clean, professional HTML, you should follow these rules:

Example: Structuring a Page

Here is how a well-structured document outline looks in code:

				
					<h1>A Guide to the Solar System</h1>
<p>The solar system consists of the Sun and the objects that orbit it.</p>

<h2>The Inner Planets</h2>
<p>These are the rocky planets closest to the sun.</p>

    <h3>Mercury</h3>
    <p>The smallest planet.</p>

    <h3>Venus</h3>
    <p>The hottest planet.</p>

<h2>The Outer Planets</h2>
<p>These are the gas and ice giants.</p>

    <h3>Jupiter</h3>
    <p>The largest planet.</p>