HTML <title> Tag

Beginner
6 min read
Updated: Nov 2026
4 examples
Live preview

Definition and Usage

The <title> element defines the document title shown in the browser tab (or title bar), bookmarks, and often in search results. It contains text only — any markup inside is treated as plain text.

Place exactly one <title> inside <head>. It is metadata, not a visible page heading (use <h1> for that). Pair it with other head metadata such as <meta> when you need a description or charset.

Baseline · Widely available.

Not deprecated. Required for a complete HTML document. Stable across browsers since about July 2015 (and much earlier in practice).

Always close </title>.

Both tags are required. Leaving off the end tag can make the browser ignore the rest of the page.

Accessibility & SEO tip.

Put the unique page topic first, then the site name. Keep titles unique per page and roughly under 55–60 characters so search snippets stay clear.

HTML Syntax

syntax.html
<title> Page topic - Site name</title>

Both start and end tags are required. Parent must be a <head> that has no other <title>. Content is text (not inter-element whitespace only).

Attributes

The <title> element has no element-specific attributes — only global attributes.

AttributeDescriptionNotes
None specificNo dedicated attributes on <title> itself.No ARIA role is permitted on this element.

Global Attributes

The <title> tag also supports the Global Attributes in HTML.

Live Preview

Pick a title style and see how it might look in a browser tab (simulation).

Real <title> lives in <head> and updates the actual tab text.

Tab preview

<title>HTML title Tag (Document Tab Title)</title>

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor (open the editor to see the tab title change).

Example 1 — Basic Document Title

Put a clear text title inside <head>.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>About Our Team</title>
</head>
<body>
  <h1>About Our Team</h1>
</body>
</html>
Try It Yourself

How It Works

  1. Open <head> after <html>.
  2. Add <title>…</title> with plain text.
  3. Close </title> before other body content.
  4. The browser tab shows that text; the <h1> is separate visible content.

Example 2 — Unique Page Topic First

Lead with the page purpose, then the site name — helpful for tabs, screen readers, and SEO.

HTML
<head>
  <meta charset="UTF-8">
  <title>Menu - Blue House Chinese Food</title>
</head>
Try It Yourself

How It Works

  1. Name the page (“Menu”) so listeners hear the purpose first.
  2. Add the site or brand after a separator.
  3. Keep it unique across your site — avoid the same title on every page.
  4. Stay concise so search results do not cut off the important part.

Example 3 — title vs h1

title is for the tab; h1 is the main on-page heading. They can match or differ slightly.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Shipping Policy - ShopCo</title>
</head>
<body>
  <h1>Shipping Policy</h1>
  <p>Orders usually ship within 2 business days.</p>
</body>
</html>
Try It Yourself

How It Works

  1. <title> — tab / bookmark / search snippet metadata.
  2. <h1> — the visible main heading in the body.
  3. Brand can live in title without cluttering the h1.
  4. Both should describe the same page so users are not confused.

Example 4 — Reflect Important Page State

When a form fails, update the title so assistive tech and tabs surface the problem early.

HTML
<title>2 errors - Your order - Sea Food Store</title>
Try It Yourself

How It Works

  1. Put the status first (“2 errors”) when the page state matters.
  2. Keep the page name so context stays clear.
  3. Update on the server or with script after validation fails.
  4. Remember: screen readers may not announce a live title change alone — use a live region for critical alerts when needed.

Edge Cases & Pitfalls

Most title problems are missing tags, duplicate site-wide titles, or stuffing keywords.

close

Never omit </title>

Without the end tag, browsers may treat the following markup as part of the title and break the page.

unique

One unique title per page

Duplicate or near-duplicate titles across your site confuse users and search results. Vary the page-specific part.

seo

Avoid keyword blobs

A list of unrelated words does not help rankings. Write a natural, descriptive phrase with the important words early.

markup

Text only inside title

Do not put links, bold tags, or other HTML inside. They will not style the tab — they show as characters.

Browser Support

The <title> element is core HTML metadata in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<title>

Widely available since about July 2015 (and long before). Every major browser shows the title in the tab, window, and history UI.

99% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<title> Universally supported

Bottom line: Required on every HTML page. Keep one closed title in head, unique and descriptive for each URL.

Key Takeaways

  • Role: <title> sets the tab / bookmark / search title text.
  • Placement: exactly one inside <head>, always with a closing tag.
  • Writing: unique page topic first, site name second, no keyword stuffing.
  • Not h1: title is metadata; the visible heading stays in the body.

One line: put a unique, closed <title> in <head> with the page topic first.

Default CSS Settings

title is metadata in head — it is not rendered in the page body, so there is no useful visual UA stylesheet:

default.css
head title {
  display: none; /* not shown in the document body */
}

Styling the browser chrome (tab text) is not possible with page CSS. Change the title by editing the element text (or updating it with script).

Frequently Asked Questions

The title element sets the document title shown in the browser tab, bookmarks, and often in search results. It belongs in the head, not in the visible page body.
Always inside <head>, and only once per document. Do not put title in the body.
title is metadata for the tab and SEO. h1 is a visible heading on the page. You usually need both, and they can say similar things without being identical.
Aim for a clear phrase, roughly under 55–60 characters so search engines do not cut off the important part. Put the unique page topic first.
No useful markup. Any tags inside title are treated as plain text, so write text only.
No. It is Baseline, required for a proper HTML document, and widely available.

Next: tr

Define a table row with the HTML tr element.

tr tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful