HTML Tags

HTML <h1 to h6> Tag

HTML provides six levels of headings, <h1> through <h6>, to define content hierarchy and structure.

  • <h1> is the largest and most important heading.
  • <h6> is the smallest and least important heading.
    Headings help browsers, search engines, and screen readers understand the structure of a page.

Syntax

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

Attributes

AttributeDescription
classAssigns one or more class names for styling.
idAssigns a unique identifier to the heading.
styleAdds inline CSS styles.
titleProvides additional information as a tooltip.

Example

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

Output

Browser Output

Use our TryIt Editor to see the output.

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

Headings are visible and structured from largest (<h1>) to smallest (<h6>), helping organize content on the page.

Notes

  • Headings are block-level elements by default.
  • Always use headings in order (<h1><h2><h3>) for proper semantic structure.
  • Headings improve SEO and accessibility.
  • Styles can be modified with CSS, but the semantic meaning remains.

Conclusion

HTML headings <h1> to <h6> define content hierarchy and page structure.
Using them correctly ensures better readability, SEO optimization, and accessibility for all users.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend