3 min read · Free · No login needed
Headings give a page its structure. They tell the reader — and Google — what each section is about. HTML has six heading levels, from <h1> (the biggest and most important) to <h6> (the smallest).
<h1> — the main title of the page. Use it only once per page.<h2> — the main sections of the page.<h3> — sub-sections inside an h2 section.<h4> to <h6> — deeper sub-sections, used rarely.Think of a book: h1 is the book title, h2 is a chapter, h3 is a section inside the chapter. Skipping levels — for example, jumping from h1 straight to h4 — confuses both readers and search engines.
A common beginner mistake is using a heading tag only to make text big. Headings are about meaning, not size. If you want big text that is not a heading, use CSS to change the font size. Search engines give real weight to headings, so a page with a clear h1, h2, h3 structure ranks better than a page where every line is an h1.
Headings are the outline of your page, like the chapter titles of a book. <h1> is the book title — the most important heading, used once. <h2> marks the main chapters, <h3> marks sections inside a chapter, and so on down to <h6>. Search engines and screen readers use this outline to understand your page.
| Tag | Size | Use it for |
|---|---|---|
<h1> | largest | The main title of the page — only once per page. |
<h2> | large | Main sections, like chapters. |
<h3> | medium | Sub-sections inside an h2 section. |
<h4> | smaller | Smaller points inside an h3 section. |
<h5> | small | Fine detail — rarely needed. |
<h6> | smallest | Fine detail — rarely needed. |
A good outline looks like a staircase, going down one step at a time:
<h1>Computer Course</h1> <h2>HTML</h2> <h3>Tags</h3> <h3>Attributes</h3> <h2>CSS</h2>
style="font-size: 32px;" on a paragraph. Headings are for structure, and search engines treat them as a map of your page.<h1> on a page — it confuses search engines about the main topic.<h2> straight to <h4> — go one step at a time.<!DOCTYPE html>, <html>, <head> and <title>Headings</title> — the usual page skeleton. The title shows on the browser tab.<h1>Learn HTML</h1> — the main title of the page, the biggest heading. Use it only once per page.<h2>Chapter 1: Basics</h2> — a main section, like a chapter in a book. It is smaller than h1.<h3>What is HTML?</h3> — a sub-section inside the chapter. It is smaller than h2.<h4>, <h5> and <h6> — smaller and smaller headings for deeper detail. They are used rarely, and h6 is the smallest heading HTML has.<!DOCTYPE html>
<html>
<head>
<title>Headings</title>
</head>
<body>
<h1>Learn HTML</h1>
<h2>Chapter 1: Basics</h2>
<h3>What is HTML?</h3>
<h4>A smaller heading</h4>
<h5>Even smaller</h5>
<h6>The smallest heading</h6>
</body>
</html>
Change the code below and press Run to see the result instantly. No file to save, no login needed.
The questions learners ask most about this lesson — read the question, then open it to see the answer.
Six, from h1, the biggest and most important, to h6, the smallest.
Only once per page, for the main title. Using more than one confuses search engines about the main topic.
No. Headings are about meaning and structure, not size. Use CSS to change font size instead.
AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.
Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.
Take the testPrefer watching? Video courses teach the same topics step by step.
Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.
Browse all coursesAsk about courses, website & more
Request human callback:
Please log in to download. You will stay on this page after logging in!
New here? Register now →