The <h1> through <h6> elements mark six levels of section headings. <h1> is the highest (main topic); <h6> is the lowest. By default they are block-level and take the full width of their container.
Use headings for structure, not as a way to enlarge text — size with CSS font-size instead. Prefer one <h1> per page, then nest <h2>, <h3>, and so on without skipping ranks. Do not confuse them with <header> (an intro container).
Baseline · Widely available.
Not deprecated. Stable across browsers since about July 2015 (and much earlier in practice).
Accessibility warning.
Do not skip heading levels (for example h1 then h3). Screen reader users often browse by headings and expect a continuous outline.
Syntax
HTML Syntax
syntax.html
<h1–6>heading text</hn>
Both start and end tags are required. Content is phrasing content (text and inline markup). Implicit ARIA role is heading with a matching level.
Reference
Attributes
Heading elements have no element-specific attributes — only global attributes.
Attribute
Description
Notes
None specific
No dedicated attributes on <h1>–<h6>.
Use id for in-page links and class for styling.
Experimental.
Global headingoffset / headingreset can change the computed heading level for assistive tech. Limited support — do not rely on them in production yet.
Start with <h1> for the page (or main topic) title.
Use <h2> for major sections under that topic.
Nest <h3> / <h4> for subsections — step down one level at a time.
When a subsection ends, you may return to a previous level (for example another h3 after an h4).
Example 3 — Typical Article Page
One h1, then h2 sections with short content under each.
HTML
<h1>Heading elements</h1>
<h2>Summary</h2>
<p>Headings organize a page into sections.</p>
<h2>Examples</h2>
<h3>Example 1</h3>
<p>A basic outline starts with h1, then h2.</p>
<h3>Example 2</h3>
<p>Subsections use the next level down.</p>
<h2>See also</h2>
<p>Related tags include header and section.</p>
This h2 looks large, but it remains level 2 in the outline.
How It Works
Choose the correct level for the outline (h2 under h1).
Add a class for visual design.
Set font-size (and color) in CSS — not by swapping to h1 just to look bigger.
Assistive tech still hears “heading level 2,” which keeps navigation honest.
Edge Cases & Pitfalls
Most heading bugs are skipped levels, fake big text, or too many h1s.
a11y
Do not skip levels
Avoid h1 → h3. Screen reader users rely on a continuous outline when jumping headings.
seo
Prefer one h1
Multiple h1s are allowed but not recommended. One clear page title works best for people and search engines.
style
Not a font tool
Never pick h1 only because it looks bigger. Use CSS font-size on the correct level.
names
heading ≠ header ≠ title
h1–h6 are headings. <header> is a container. <title> is the document tab name in <head>.
history
No outline algorithm trick
Do not rely on old “sectioning resets the outline” ideas. Rank headings explicitly with the right h* level.
Compatibility
Browser Support
The <h1>–<h6> elements are core HTML heading content in every browser. They are not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<h1>–<h6>
Widely available since about July 2015 (and long before). Chrome, Firefox, Safari, Edge, and Opera all support heading elements with default block styling.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
HeadingsWidely supported
Bottom line: Safe to use everywhere. Focus on a clean outline: one main h1, no skipped levels, CSS for looks.
Remember
Key Takeaways
Levels:h1–h6 rank section titles from highest to lowest.
Outline: prefer one h1; nest without skipping ranks.
Style: change size with CSS, not by misusing heading tags.
Override freely for design, but keep the HTML levels meaningful for the outline.
Frequently Asked Questions
The h1–h6 elements mark six levels of section headings. h1 is the highest (most important) level; h6 is the lowest.
Prefer one h1 that names the main topic of the page (similar in spirit to the document title). Multiple h1s are allowed by the standard but are not best practice.
Avoid it. Screen reader users often jump heading by heading; skipped levels make the outline confusing. Nest subsections without jumping ranks.
No. Use CSS font-size for visual size. Headings exist for structure, SEO, and accessibility — not as a font shortcut.
No. h1–h6 are heading elements. The header element is a container for introductory content that may include a heading.
Browsers and assistive tools can build a contents list from headings. Keep levels ordered so that outline is useful.