HTML Headings

HTML Headings are used to define titles and subtitles on a web page.
They help organize content and improve readability for both users and search engines.

In this tutorial, you will learn HTML heading tags, their importance, and see examples with output.

What Are HTML Headings

HTML headings are defined using <h1> to <h6> tags.

They are used to:

  • Create titles and subtitles
  • Structure content
  • Improve SEO and readability

HTML Heading Tags List

There are six levels of headings in HTML.

Heading Tags Table

TagDescription
<h1>Main heading (largest)
<h2>Subheading
<h3>Section heading
<h4>Smaller heading
<h5>Smaller heading
<h6>Smallest heading

HTML Headings Example

Example Code

<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Section Heading</h3>
<h4>Small Heading</h4>
<h5>Smaller Heading</h5>
<h6>Smallest Heading</h6>

Output

Main Heading
Sub Heading
Section Heading
Small Heading
Smaller Heading
Smallest Heading


Explanation of Heading Sizes

  • <h1> is the largest and most important
  • <h6> is the smallest and least important
  • Size decreases from h1 to h6

Importance of HTML Headings

Why Headings Matter

ReasonExplanation
SEOSearch engines use headings to understand content
StructureOrganizes web pages
ReadabilityMakes content easy to scan
AccessibilityHelps screen readers

HTML headings, h1 to h6 tags, HTML heading examples, HTML tutorial, learn HTML headings


Proper Use of Headings

Correct Example

<h1>Website Title</h1>
<h2>Section 1</h2>
<h3>Subsection</h3>

Output

Website Title
Section 1
Subsection


Incorrect Use of Headings

Example

<h1>Main Title</h1>
<h4>Wrong Order</h4>

Problem

  • Skipping heading levels breaks structure
  • Bad for SEO

Only One <h1> Per Page

Example

<h1>My Website</h1>
<h2>About Us</h2>
<h2>Services</h2>

Explanation

  • Use only one <h1> for main title
  • Use <h2> to <h6> for subheadings

Styling Headings with Attributes

Example Code

<h1 style="color: blue;">Blue Heading</h1>

Output

Blue Heading (in blue color)


HTML Headings vs Paragraphs

Comparison Table

FeatureHeadingsParagraph
PurposeTitlesText content
Tags<h1> to <h6><p>
ImportanceHighNormal

Common Mistakes with Headings

MistakeResult
Using multiple <h1>Poor SEO
Skipping levelsBad structure
Using headings for styling onlyWrong practice
Overusing headingsCluttered content

HTML Headings Example with Page Structure

Example Code

<h1>HTML Tutorial</h1>
<h2>Introduction</h2>
<p>This is the introduction section.</p><h2>Topics</h2>
<h3>HTML Basics</h3>
<p>Basic concepts of HTML.</p>

Output

HTML Tutorial
Introduction
This is the introduction section.

Topics
HTML Basics
Basic concepts of HTML.


You may like


Frequently Asked Questions (FAQ)

1. How many heading tags are there in HTML?

There are six heading tags from <h1> to <h6>.

2. Which heading is most important?

<h1> is the most important heading.

3. Can I use multiple <h1> tags?

It is not recommended for SEO.

4. Do headings affect SEO?

Yes, headings are very important for SEO.

5. Can I style headings?

Yes, using CSS or style attribute.

Related Article
Introduction to HTML

HTML Introduction – Learn the Basics of HTML HTML is the starting point of web development. Every website you see Read more

What is HTML

What Is HTML – Complete Beginner Explanation HTML is the foundation of the web. Every website you visit, from simple Read more

HTML Basic Examples

HTML Basic Examples – Learn HTML by Practice The best way to learn HTML is by writing and testing simple Read more

HTML text Editors

HTML Text Editors – Learn How to Write HTML Code To write HTML code, you need a text editor. A Read more

HTML Tags

HTML Tags are the basic units used to create HTML elements.They define how content is displayed in a web browser. Read more

HTML Elements

HTML Elements are the building blocks of every web page.Each element defines a part of the webpage, such as headings, Read more

HTML Attributes

HTML Attributes provide additional information about HTML elements.They help control how elements behave, display, or store extra data. In this Read more

HTML Paragraphs

HTML Paragraphs are used to display blocks of text on a web page.They help organize content into readable sections. In Read more