Skip to content
Tutorials Center
My learning

Topics

HTML Reference ยท Document and Metadata

The <title> element

Reference for the HTML <title> element: where the page title appears, how to write a good one for users and search engines, examples and technical details.

The <title> element gives the document its title: the text shown in the browser tab, in bookmarks and history, as the default name when someone shares or saves the page, and usually as the clickable headline in search results. Every HTML document needs exactly one, inside the <head>.

HTML
<head>
  <meta charset="utf-8">
  <title>Returns and refunds โ€“ Northwind Outdoor</title>
</head>

Try it

Changing the title from a script

The preview is an embedded frame, so its title doesn't reach your browser tab, but document.title shows what a tab would display. Apps often use this pattern to signal unread items.

Attributes

This element has only the global attributes. Note that the global title attribute (a tooltip on any element) is unrelated to this element.

Usage notes

  • Write it for people first. Start with what is unique about the page, then add the site name: "Returns and refunds โ€“ Northwind Outdoor" beats "Northwind Outdoor โ€“ Page 7". Keep it short enough to read in a narrow tab; around 50โ€“60 characters avoids truncation in most search results.
  • Unique per page. Identical titles make tabs, history and search results impossible to tell apart. More advice is in Page Titles and Descriptions.
  • Accessibility. The title is the first thing a screen reader announces when a page loads, and it helps everyone find the right tab. In single-page apps, update document.title on every view change.
  • Text only. The content is plain text: tags inside are shown literally, not parsed. Character references such as &amp; do work.
  • Not a heading. The title lives outside the page content. The page still needs its own visible <h1>, which is often similar but need not be identical.

Technical summary

Content categories Metadata content
Permitted content Text that is not inter-element whitespace
Tag omission None; both the start and end tags are required
Permitted parents A <head> element that contains no other <title> element
Implicit ARIA role No corresponding role
DOM interface HTMLTitleElement
Default display none

Browser support

Supported in every browser.