H.dev

HTML Heading Tags

When I am writing an article or structuring a webpage, I need a way to organize content so that readers can quickly scan it. In HTML, heading tags ranging from <h1> to <h6> are used to define the structure and layout of text on a web page.

These tags create a clear hierarchy. This isn't just useful for human readers; it's also absolutely crucial for search engines like Google when they index your page!

The <h1> Tag: The Main Title

The <h1> tag defines the first-level heading. It is typically the largest and boldest heading on your page. Think of it as the main title of your book or the headline of a newspaper article.

<h1>Himubey's Ultimate Web Dev Guide</h1>

Pro-tip: You should generally only use one <h1> tag per page. It represents the main topic of that specific page.

The <h2> Tag: Second-Level Headings

The <h2> tag is used for second-level headings. It is slightly smaller than the <h1> tag and is commonly used for major section titles within your page.

<h2>Chapter 1: Getting Started with Next.js</h2>

The <h3> to <h6> Tags: Diving Deeper

As you might guess, <h3> is used for sub-sections within an <h2>, <h4> within an <h3>, and so on. They keep getting progressively smaller.

<h3>Why I chose React</h3>
<h4>Setting up your environment</h4>
<h5>Node.js installation</h5>
<h6>Troubleshooting errors</h6>

Why Do Headings Matter?

As a developer, I (Himanshu) always make sure my headings are in order. Proper use of heading tags not only improves the readability and accessibility of your web page for users relying on screen readers, but it also optimizes it for search engine rankings. A well-structured page is a happy page!

💡 Himubey Tip

Never use heading tags just to make text bold or big! If you want large text that isn't a heading, use a <p> tag and style it with CSS. Headings should be strictly used for defining the structural outline of the document.

Interview Questions

  1. How many heading tags are available in HTML, and what are they?
  2. Why should a webpage ideally only have one <h1> tag?
  3. How do heading tags impact SEO and web accessibility?

Design & Developed by Himanshu Dubey © 2026