title – page title

<title>Page title</title>

The title of the document. It appears in the browser tab and history, as the default name of a bookmark and as the blue link in search results. It belongs in the head, and every page should have its own descriptive title.

  • Default display: display: none
  • End tag: required
  • Content: text only – tags inside are not rendered and stay as text (entities such as &amp; are converted, though)
  • Where it can be used: head, exactly once per page
  • DOM interface: HTMLTitleElement

Attributes

Only global attributes.

Examples

First what makes the page different, then the name of the website:

<title>Sourdough bread – Mill Lane Bakery</title>

Changing the title from JavaScript (the number of unread messages, for example):

<script>
  document.title = '(3) Messages – My account';
</script>

Accessibility

The page title is the first thing a screen reader reads after the page loads, and blind users find their way between open tabs by their titles. That is why it should be unique and start with the content of the page, not with the same website name every time.

Things to watch out for

  • Search engines shorten a long title by its width – Google usually fits roughly 50–60 characters (as of October 2026). Google may also replace the title in results with its own when the one given does not match the content.
  • Tags in the title do not work: <title>Sale <b>-50 %</b></title> shows a literal <b> in the tab. Entities are converted, so &amp; appears as & in the tab.
  • document.title returns the title with whitespace collapsed and without spaces at the start and end.
  • The title is not shown in the page – the heading of the page is h1. The two are usually similar but do not have to be the same.

Browser support

Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1. As of October 2026 (MDN browser-compat-data).

Related:
head – document head
meta – metadata
h1–h6 – headings
title – element tooltip (attribute)