HTML

HTML Heading and Paragraph Tags: How to Structure Text

How to use HTML headings (h1–h6) and paragraphs the right way, so readers and search engines can follow the structure of your content.

RazakTerra
Reading time
2 min read
Comments
Discussion
HTML Heading and Paragraph Tags: How to Structure Text
On this page
  1. Heading Tags (h1 to h6)
  2. The Paragraph Tag
  3. Why Hierarchy Matters
  4. Quick Tips

Heading Tags (h1 to h6)

HTML gives you six levels of headings, from the most important to the least important:

All heading HTML
<h1>Main Title</h1>
<h2>Section Title</h2>
<h3>Subsection Title</h3>
<h4>Smaller Heading</h4>
<h5>Even Smaller</h5>
<h6>The Smallest One</h6>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor
  • <h1> is usually used once per page for the main title.
  • <h2> is for main sections.
  • <h3> to <h6> are for subsections and smaller topics.

Using headings in the correct order creates a clear hierarchy. Don’t skip levels just because you like the size (for example, jumping from <h1> straight to <h4>).

The Paragraph Tag

For regular text, use the <p> tag:

Playground
<p>
  This is a paragraph. It contains normal body text that explains your content.
</p>
<p>You can have multiple paragraphs. Each one should focus on one main idea.</p>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor

Browsers automatically add space before and after paragraphs, so your text doesn’t look cramped.

Why Hierarchy Matters

A good heading structure makes your content:

Easier for people to scan Clearer for screen readers More friendly for SEO (search engines understand the topic better)

Think of it like a book outline. The <h1> is the book title, <h2> are the chapter titles, and smaller headings are the sub sections. Simple Example

Playground
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>How to Make Coffee</title>
  </head>
  <body>
    <h1>How to Make Coffee</h1>

    <h2>What You Need</h2>
    <p>
      You only need a few basic things: coffee beans, hot water, and a filter.
    </p>

    <h2>Steps to Brew</h2>
    <h3>1. Grind the Beans</h3>
    <p>Grind your coffee beans just before brewing for the best flavor.</p>

    <h3>2. Add Hot Water</h3>
    <p>Pour hot water slowly over the grounds and let it drip through.</p>

    <h2>Final Tips</h2>
    <p>Use fresh beans and clean equipment for better results every time.</p>
  </body>
</html>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor

Quick Tips

Use only one <h1> per page. Keep the heading order logical (don’t jump levels randomly). Write clear and descriptive headings. Don’t use headings just to make text bigger use CSS for styling instead. Keep paragraphs short and focused so they’re easier to read.

When you structure your text with proper headings and paragraphs, your content becomes cleaner, more professional, and easier for both humans and search engines to understand.

Written by

Razak

Writes about the web, slowly, and builds small tools on the side.

Discussion

Comments

Loading comments…

Keep reading