HTML CSS Bootstrap JavaScript jQuery MySQL PHP Data Mining

HTML Headings

Written by RedoHub Team · Last updated: July 31, 2026

HTML headings are used to define titles and subtitles on a web page. They are one of the most important structural elements in HTML.


HTML Heading Tags

HTML provides six levels of headings, from <h1> (most important / largest) to <h6> (least important / smallest):

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Here is how each heading looks in a browser:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Headings Tag Reference

Tag Description Default Size
<h1>Most important heading — page title2em (32px)
<h2>Section heading1.5em (24px)
<h3>Sub-section heading1.17em (~18.7px)
<h4>Sub-sub-section heading1em (16px)
<h5>Minor heading0.83em (~13.3px)
<h6>Least important heading0.67em (~10.7px)

Headings and SEO

Search engines use headings to understand the structure and topic of your page. The <h1> heading carries the most weight for SEO:

  • Use exactly one <h1> per page — it should describe the main topic
  • Use <h2> for major sections
  • Use <h3> for sub-sections under <h2>
  • Never skip heading levels (don't jump from <h1> to <h3>)
  • Do not use headings just to make text bigger — use CSS for that
SEO Note: Google reads your <h1> to understand what the page is about. Make it descriptive, keyword-rich, and unique for every page.

Headings and Page Structure

Think of headings like a document outline. Here is a good structure for a web page:


<h1>Learn HTML</h1>        <!-- Page title -->
<h2>Introduction</h2>      <!-- Section 1 -->
<h3>What is HTML?</h3>     <!-- Sub-section -->
<h3>History of HTML</h3>   <!-- Sub-section -->
<h2>HTML Elements</h2>     <!-- Section 2 -->
<h3>Tags</h3>
<h3>Attributes</h3>
<h2>HTML Forms</h2>        <!-- Section 3 -->

Bigger Headings with Style

You can change the size of any heading using the style attribute and the font-size CSS property:

<h1 style="font-size: 60px;">Very Large Heading</h1>
<h1 style="font-size: 20px;">Small h1 Heading</h1>
Best Practice: Use headings for structure and meaning, not for visual size. If you only want bigger text, use CSS font-size on a <p> or <span> instead.

Common Mistakes to Avoid

Using more than one <h1> per page. Screen readers and search engines expect a single, clear page title. If every section needs to look "big," that's a job for CSS, not a second <h1>.
Choosing a heading level by how big it looks. Don't pick <h3> over <h2> just because it renders at the font size you want — style the existing heading with CSS instead.
Skipping levels in the outline. Jumping from <h1> straight to <h4> breaks the document outline that screen-reader users navigate by section.

Try It: A Blog Post Outline

A properly nested heading structure for a short blog post:

<h1>5 Tips for a Faster Website</h1>

<h2>1. Compress Your Images</h2>
<h3>Choosing the right format</h3>
<h3>Using lazy loading</h3>

<h2>2. Minify CSS and JavaScript</h2>

<h2>3. Use a Content Delivery Network</h2>

Rendered result:

5 Tips for a Faster Website

1. Compress Your Images

Choosing the right format

Using lazy loading

2. Minify CSS and JavaScript

3. Use a Content Delivery Network

(Sizes above are reduced with Bootstrap classes just so the outline fits on this page — in real use you'd let the browser's default heading sizes apply.)


Frequently Asked Questions

Q: How many <h1> tags should a page have?

A: Exactly one. It should describe the main topic of that specific page.

Q: Do headings affect SEO ranking directly?

A: Search engines use headings to understand page structure and topic relevance, but a heading alone won't rank a page — it needs to accurately describe genuinely useful content underneath it.

Q: Can I skip from <h1> to <h4>?

A: You can, and the page will still render, but it's considered bad practice — see the MDN heading elements guide for how the outline should nest.