Ad – 728Γ—90
🌐 Beginner

HTML Headings – h1 Through h6

HTML headings create the outline of your page. They are used by browsers to display a visual hierarchy, by search engines to understand page structure, and by screen readers to let users navigate. Getting headings right has a direct impact on SEO and accessibility.

⏱️ 12 min read🎯 BeginnerπŸ“… Updated 2026

The Six Heading Levels

HTML
<h1>Page Title β€” Most Important (one per page)</h1>
<h2>Major Section</h2>
<h3>Sub-section</h3>
<h4>Sub-sub-section</h4>
<h5>Rarely used β€” deep hierarchy</h5>
<h6>Almost never used</h6>
β–Ά Browser renders:
Page Title β€” Most Important Major Section Sub-section Sub-sub-section Rarely used Almost never used

Headings and SEO

Search engines read your heading hierarchy to understand what a page is about and how it is structured. Key rules:

  • One <h1> per page β€” it is the page's primary topic. Search engines treat it as the most important signal.
  • Include target keywords in headings β€” especially <h1> and <h2>.
  • Don't skip levels β€” going from <h2> to <h4> signals poor structure to both crawlers and users.
Ad – 336Γ—280

Headings and Accessibility

Screen reader users can navigate a page by jumping between headings β€” like a table of contents. This is often the primary way blind users scan long pages for relevant content. A proper heading hierarchy (h1 β†’ h2 β†’ h3) creates an accessible document outline.

Real-World Heading Structure

HTML – Article with proper heading hierarchy
<h1>The Complete Guide to CSS Flexbox</h1>

  <h2>What is Flexbox?</h2>
    <h3>Flex Container vs Flex Items</h3>
    <h3>Main Axis and Cross Axis</h3>

  <h2>Flex Container Properties</h2>
    <h3>flex-direction</h3>
    <h3>justify-content</h3>
    <h3>align-items</h3>

  <h2>Flex Item Properties</h2>
    <h3>flex-grow and flex-shrink</h3>
    <h3>align-self</h3>

  <h2>Practical Examples</h2>

Common Heading Mistakes

MistakeProblemFix
Multiple <h1> tagsConfuses search engines about page topicOne <h1> only
Using headings for big textPollutes document outlineUse CSS font-size for visual size
Skipping levels (h2 β†’ h4)Broken accessible outlineFollow strict hierarchy
Empty headingsAccessibility failureAlways put meaningful text in headings
⚠️
Don't use headings just to make text big

If you want large text for decorative or design purposes, use CSS font-size on a <p> or <span>. Misusing headings pollutes the page's semantic structure β€” screen readers will announce the text as a heading when it is not one.

πŸ“‹ Summary

  • HTML has 6 heading levels: <h1> (most important) to <h6> (least important).
  • Use exactly one <h1> per page β€” the main topic.
  • Follow a logical hierarchy β€” don't skip levels.
  • Headings affect SEO rankings and screen reader navigation.
  • Never use headings just for visual size β€” use CSS for that.

FAQ

Can the logo/site name be the h1? +

On the homepage, yes β€” many sites make their brand name the h1. On interior pages (blog posts, product pages), the h1 should be the page's topic, not the brand. Search engines look at the h1 to understand what the specific page is about.

Does heading order affect CSS? +

Browsers apply default styles β€” h1 is biggest, h6 is smallest. You can override all of this with CSS. But the HTML semantic order (h1 β†’ h2 β†’ h3) should reflect document structure regardless of visual appearance.