HTML Introduction | HTML Text Elements | Headings

Headings <h1>-<h6>

HTML provides tags for representing headings from <h1> to <h6>.
You can express headings in various sizes, from the largest <h1> tag to the smallest <h6> tag.

Example

<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>

Run code

A small amount of spacing is automatically inserted above and below the <h1>-<h6> tags.

Headings are important.

Search engines use headings to index the structure and content of web pages.
Because users understand page content by looking at headings, using headings in the document structure is important. The <h1> heading should be used as the main heading, followed by <h2>, and then less important headings such as <h3>.
Use HTML headings only for headings.
Do not use headings simply to make text large or bold.