Codectionary / Developer documentation / HTML

<title>

The <title> element defines the title of the document, shown in the browser tab, bookmarks, and search engine results. Every HTML document should have exactly one <title>, placed inside <head>. It must contain only text — no nested elements.

Syntax

<title>Page Title</title>

Examples

Basic Page Title

A simple, descriptive page title.

<head>
  <title>Codectionary - Learn to Code</title>
</head>

Dynamic Page Title Pattern

A common convention for per-page titles with a site name suffix.

<title>HTML Documentation | Codectionary</title>

Updating Title with JavaScript

Changing the title dynamically, such as for unread notifications.

<script>
  document.title = `(3) New Messages - Codectionary`;
</script>

Best practices

  • Every page needs a unique, descriptive title — it is one of the most important elements for both SEO and usability
  • Keep titles concise, roughly under 60 characters, so they do not get truncated in search results
  • Put the most important, distinguishing information first, since browser tabs truncate from the right
  • Never leave title empty or generic like "Untitled Document" — it directly affects how your page appears in search results and browser history

Browser compatibility

Support applies to the named feature, not every attribute or behaviour in this article. Versions refer to browsers, not operating systems.

<title>

Desktop

Chrome
Supported
From 1
Firefox
Supported
From 1
Safari
Supported
From 1
Edge
Supported
From 12
Opera
Supported
From 15

Mobile

Safari on iOS
Supported
From 1
Chrome for Android
Supported
From 18
Firefox for Android
Supported
From 4
Samsung Internet
Supported
From 1.0

MDN BCD record for this feature · MDN reference

Support history and limitations

Chrome

  • From 1

Firefox

  • From 1

Safari

  • From 1

Edge

  • From 12

Opera

  • From 15

Safari on iOS

  • From 1

Chrome for Android

  • From 18

Firefox for Android

  • From 4

Samsung Internet

  • From 1.0

MDN BCD 8.1.5 · Dataset built 2026-10-08 · Mapping reviewed 2026-10-21. These dates are not individual browser-test or claim-verification dates. Unknown means the data does not establish support.

HTML Living Standard

Specifications & further reading