Difference Between Paired and Unpaired Tags

// Quick Answer
  • Paired tags have opening and closing tags.
  • Unpaired tags have only one tag (self-closing).
  • Paired tags wrap content.
  • Unpaired tags do not contain content.

What are paired tags?

Paired tags are HTML elements that come in pairs — an opening tag and a closing tag.

💡 Simple idea

They wrap around content.

<p>
  This is a paragraph.
</p>

Here, <p> is the opening tag and </p> is the closing tag.

Examples of paired tags

  • <h1>...</h1>
  • <p>...</p>
  • <div>...</div>
  • <section>...</section>
  • <button>...</button>

What are unpaired tags?

Unpaired tags (also called self-closing tags) do not have a closing tag.

💡 Simple idea

They do not wrap content — they stand alone.

<br>
<img src="image.jpg" >

Examples of unpaired tags

  • <br> — line break
  • <hr> — horizontal line
  • <img> — image
  • <input> — form input
  • <meta> — metadata
📌 Important note

In modern HTML5, self-closing tags do not require a trailing "/" (like <br />), but it is still valid in XHTML style.

Key differences

  • Paired tags → have opening + closing tags
  • Unpaired tags → single tag only
  • Paired tags → contain content
  • Unpaired tags → do not contain content

Comparison example

<!-- Paired tag -->
<h1>Hello</h1>

<!-- Unpaired tag -->
<img src="photo.jpg" >

Why this matters

Understanding tag types helps you:

  • Write correct HTML
  • Avoid rendering errors
  • Understand how elements behave
  • Build cleaner web pages

Summary

Paired tags wrap content with opening and closing tags, while unpaired tags stand alone without wrapping anything.

Both are essential for building structured and functional webpages.