How Many Heading Tags are There in HTML?

Learn via video course
FREE
View all courses
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
Topics Covered

There are six levels in the heading tag in HTML. They have decreasing order of importance/level starting from 1 to 6. Heading tags in HTML are used to give a title or subtitle to the section on the webpage.

The font size decreases from <h1>

Syntax :

The headings are defined as <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, and as HTML heading tags are non-void elements, they must be terminated by using the same tag having a slash in front </h1>. In between the tags, the text is written, which will have different properties according to the heading selected.

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Attributes

It supports tag-specific attributes such as align (center, left, right) and also includes the global attribute such as class, id, etc.

Heading Vs. Paragraph

Heading tags are of six levels starting from <h1> to <h6>. They are used to highlight the important point that we are going to learn in the content written below.

The paragraph tag is defined by using the <p>...</p> tags. The content(text) written between the opening and closing tag is shown as the paragraph to the heading. A paragraph tag is generally used for the body(content) inside the heading.

For more details, follow the Heading and Paragraph Tags in HTML article on Scaler Topics.

Free Courses by top Scaler instructors
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science

Heading Tags Usage

Search engines and users both use the headings to go through the website h1 should be used to show the main keyword of the webpage. Others can be used for the subheadings.

Heading tags should only be used for the title or subtitle purpose, not to make any word/sentence bold or bigger.

We should maintain the hierarchy of the level of heading tags. There should be only one h1 tag in the article, as h1 is generally used to give the main keyword to the whole content.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Multiple <h1> Elements on One Page

We can use multiple <h1> HTML tags in a webpage, but usually, it is considered to have only one h1 tag, as the h1 tag indicates the main content of the webpage and makes it look more structured.

h1 tag is the highest level heading tag that has the largest default size. So, it should be used to show the most important text(heading) of the webpage. h1 tag should be used carefully as it can also impact the SEO.

There is no strict limit to the use of the number of h1 tags. One can have multiple h1 tags and also can have nested h1 tags on a website.

Bigger Headings

Each HTML heading tag has a definite size, but that can be altered using the font-size property in the style attribute.

Output: bigger Headings

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Examples

Output: Headings tags examples

Output: Heading tags example

Supported Browser

ElementChromeSafariOperaFirefox
<h1> - <h6>yesyesyesyes

Conclusion

  • There are six levels in the heading tag in HTML. They have decreasing order of importance/level starting from 1 to 6.
  • HTML heading tags are non-void elements. If they are opened, they must be closed.
  • It is recommended to have only one <h1> tag in the webpage, as it indicates the content of the webpage, and also, h1 is an important part of SEO.
  • The bigger size of the heading tag can be achieved by using the style attribute of the CSS.