Skip to main content
D
HTML
HTML Headings

HTML Headings

HTML headings define titles and subtitles on a webpage.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

HTML headings define titles and subtitles on a webpage. They create the document structure and outline. The `

` tag defines the most important heading, while `

` defines the least important.

Syntax

Syntax
1<h1>Page Title — only ONE per page</h1>
2<h2>Section Heading</h2>
3<h3>Subsection</h3>
4<h4>Sub-subsection</h4>
5<h5>Rarely used</h5>
6<h6>Rarely used</h6>

Example

Example
1<!-- this defines an article heading -->
2<!DOCTYPE html>
3<html lang="en">
4  <head>
5    <meta charset="UTF-8">
6    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7    <title>Headings</title>
8  </head>
9  <body>
10    <h1>HTML5 Notes</h1>
11    <h2>Syntax</h2>
12  </body>
13</html>

Try it Yourself

Hands-on Practice
Modify the code below to see how it affects the output. This is the best way to learn!
Interactive Editor
1234567891011121314151617181920
Live Preview

Key Points

  • Headings structure the document.
  • Search engines index page headings.
  • Browsers resize headings by default.
  • Visual size does not replace headings.

Up Next

Continue your journey with the next topic.

Go to HTML Paragraphs