HTML headings are titles or subtitles on a webpage. They are defined with the <h1> to <h6> tags. <h1> is the most important heading; <h6> is the least important. Browsers add space before and after headings by default.
Why headings matter
Search engines use headings to index structure. Users skim pages by headings. Screen readers jump from heading to heading. A clear hierarchy helps everyone.
How should you structure them?
Use <h1> for the page title (one per page), <h2> for section titles, then <h3> for sub-sections. Do not skip levels just to change visual size.
Headings vs title
The <title> in <head> is metadata for the tab and search results. An <h1> is visible body content for the main topic. Both belong in a well-built page.
One h1 best practice.
Prefer a single <h1> that names the main topic of the page, then nest lower levels under it.
Not for styling.
Do not use headings only to make text big or bold. Use CSS font-size (or semantic tags) for appearance.
Default size is not the meaning.
Browsers shrink text from h1 to h6, but the tags mean hierarchy—you can restyle any level with CSS.
Syntax
HTML Heading Syntax
Each heading level is a normal element with start tag, content, and end tag:
heading.html
<h1>Heading text </h1>
HTML
<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>
Typical outline: <h1> page title → <h2> sections → <h3> sub-sections. Change visual size with CSS, not by picking the wrong level.
Reference
Core HTML Concepts
Rules that keep heading outlines useful:
Concept
Meaning
<h1>–<h6>
Six heading levels from most to least important
One <h1>
Best practice: one main topic heading per page
Sequential levels
h1 → h2 → h3; do not skip for style
<title> vs <h1>
Tab/search metadata vs visible main heading
Structure, not style
Headings mark outline; CSS controls size
SEO & a11y
Search engines and screen readers use the outline
Default margins
Browsers add space above and below headings
Heading vs title
<title>
<h1>
Location
Inside <head>
Inside <body>
Visible on page?
No (tab / bookmark)
Yes
Main job
Document name for UI & search
Main topic of the content
Approach
How to Use Headings in HTML
Practical habits for a clear outline.
Write one descriptive <h1> for the page topic.
Add <h2> for each major section.
Use <h3> (and lower) only under the matching parent level.
Keep a matching <title> in the head (can be similar wording).
Never pick a lower level only because the text looks smaller.
Restyle with CSS font-size when you need a different look.
Goal
Pattern
Page topic
<h1>Travel Guide</h1>
Section
<h2>Europe</h2>
Sub-section
<h3>France</h3>
Custom size
<h1 style="font-size: 2rem">…</h1>
Tab title
<title>Travel Guide</title> in head
Try it
Live Preview
Compare all six levels, a proper outline, a skipped-level mistake, and CSS sizing.
Shows how heading levels render. Prefer outline over skipping levels for style.
Rendered page
This is heading 1
This is heading 2
This is heading 3
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
Code
HTML Examples
Six patterns: all levels, hierarchy, one h1, title vs h1, CSS size, and a full page.
Example 1 — Headings h1 to h6
HTML
<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>
<h1>My Blog</h1>
<h2>Latest Posts</h2>
<p>A short intro to this week’s articles.</p>
<h2>About the Author</h2>
<p>Writer, teacher, and coffee enthusiast.</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gardening Tips for Beginners</title>
</head>
<body>
<h1>Gardening Tips for Beginners</h1>
<p>The title sets the tab name; the h1 greets readers on the page.</p>
</body>
</html>
<h1>Normal h1 size</h1>
<h1 style="font-size: 1.25rem">Same level, smaller look</h1>
<h2 style="font-size: 2rem">h2 that looks larger via CSS</h2>
<!-- Do not use <h3> just because you want smaller text -->
font-size changes appearance without skipping levels.
Avoid using h3 merely because default text is smaller.
Prefer stylesheets over inline styles in real projects.
Example 6 — Complete HTML Page
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Headings Example</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<h2>News</h2>
<p>Today we launched a new HTML tutorial.</p>
<h2>Tutorials</h2>
<h3>HTML Basics</h3>
<p>Start with elements, then headings and text.</p>
<h3>CSS Basics</h3>
<p>Style your headings without changing their levels.</p>
</body>
</html>
Style your headings without changing their levels.
How It Works
title names the document in the tab.
One h1 introduces the site page.
h2 / h3 build a sequential outline.
Paragraphs follow each heading with content.
Edge Cases & Pitfalls
Broken outlines usually come from styling with heading tags or jumping levels.
skip
Skipping levels for style
Going from <h1> to <h3> confuses assistive tech. Use CSS instead.
style
Headings as bold text
Do not wrap random phrases in <h2> just to enlarge them.
h1
Many competing h1s
Multiple top-level headings blur the main topic. Prefer one clear <h1>.
title
Missing title or empty h1
Tabs and search need <title>; the page needs a meaningful visible heading.
order
Illogical order
An <h3> before any <h2> breaks the outline. Keep levels sequential.
empty
Empty heading with no content after
Each heading should label real content (text or a nested subheading).
Compatibility
Browser Support
HTML heading elements (h1–h6) are part of HTML and work in all browsers.
✓ Baseline · Widely available
HTML headings
Every browser styles h1–h6 by default and exposes them to assistive technologies.
100%heading elements
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
HTML headingsUniversal
Bottom line: Use h1–h6 for structure everywhere—then style with CSS when you need a custom look.
Remember
Key Takeaways
h1–h6 define importance and document structure—not just font size.
One h1 for the page topic; then h2, h3, and lower in order.
title ≠ h1 — tab metadata versus visible main heading.
Do not skip levels for style—use CSS font-size instead.
One line: Build a sequential outline with one <h1> and nested <h2>–<h6>, keep <title> for the tab, and style size with CSS—not by skipping levels.
Frequently Asked Questions
HTML headings are titles and subtitles defined with <h1> through <h6>. <h1> is the most important (main topic); <h6> is the least important. Browsers style them larger or smaller by default and add space around them.
Best practice is one <h1> per page for the main topic. Use <h2> for major sections, then <h3> for subsections, and so on. Multiple h1s are allowed by the HTML standard but usually hurt clarity and accessibility.
The <title> in the head is metadata for the browser tab, bookmarks, and often search results. An <h1> is a visible heading in the body for the page’s main topic. Use both; they serve different jobs.
Do not skip levels to change visual size (for example jumping from h1 to h3). Keep a logical outline: h1, then h2, then h3. Use CSS font-size if you need a different look.
No. Headings describe document structure. To enlarge or emphasize non-heading text, use CSS (or semantic tags like <strong> when meaning requires it), not h1–h6.
Search engines and screen-reader users rely on headings to understand and navigate page structure. Clear, sequential headings help both indexing and keyboard/screen-reader navigation.