Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials HTML HTML Headings
HTML Beginner FREE

HTML Headings

Lesson 1 of 16 Beginner Interactive

HTML provides six levels of headings — from <h1> (most important) to <h6> (least important).

When to Use

  • <h1> — Main heading of the page (use only once)
  • <h2> — Section headings
  • <h3> — Sub-section headings
  • <h4> to <h6> — Smaller headings

Tip: Don't skip heading levels. Always go from h1 → h2 → h3, not h1 → h3.

Syntax

HTML
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
All Heading Levels
HTML
<!DOCTYPE html>
<html>
<body>
    <h1>This is Heading 1</h1>
    <h2>This is Heading 2</h2>
    <h3>This is Heading 3</h3>
    <h4>This is Heading 4</h4>
    <h5>This is Heading 5</h5>
    <h6>This is Heading 6</h6>
</body>
</html>
Output

Heading 1

Heading 2

Heading 3

Practice

1
Exercise

Create a page with an h1 heading and two h2 sub-headings.

Answer
<h1>Main Title</h1>
<h2>Section 1</h2>
<h2>Section 2</h2>

Quick Quiz

1

Which heading tag is the largest?

<h1> is the largest heading tag.

Interview Questions

Search engines use the h1 tag to understand the main topic of a page. Having one clear h1 helps search engines properly index and rank the page. Multiple h1 tags can confuse search engines.