- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML <title> Tag
HTML Tags
HTML <title> Tag
The title tag sets the name of the page in the browser tab, in bookmarks and, most importantly, as the blue clickable headline in Google results. It never appears on the page itself.
That last point confuses beginners: you write a title, open the page, and it is nowhere to be seen. Look at the browser tab instead. Every HTML page needs exactly one <title>, inside the <head>.
Syntax
html
<title>Page Title Here</title>It has no attributes. The text inside is plain text; tags inside it are shown literally, not as formatting.
Example
html
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML Title Tag Example</title>
<meta charset="UTF-8">
<meta name="description" content="Example showing how the title tag works in HTML.">
</head>
<body>
<h1>Welcome to My Website</h1>
<p>The page title appears in your browser tab, not on the page.</p>
</body>
</html>The page shows the heading and the paragraph. The words "HTML Title Tag Example" appear only in the browser tab.
Writing a good title
- Say what the page is about, first. "Chocolate Cake Recipe - Sara's Kitchen" beats "Sara's Kitchen - Home - Recipes - Chocolate Cake".
- Keep it around 50 to 60 characters. Google cuts longer titles off with "…" based on pixel width, so the important words should come early.
- Make every page's title different. Ten pages called "Home" look identical in search results and in a row of browser tabs.
- Write for people, not for keywords. Repeating a search phrase three times does not help, and Google may rewrite titles it thinks are spammy.
Google sometimes shows a different title from the one you wrote, often taken from your main heading, when it thinks that matches the search better. A clear, accurate <title> makes that less likely. Descriptions and sharing previews are covered in HTML Meta Tags for SEO.
Browser Support
Chrome | Edge | Firefox | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
Good to know
- One
<title>per page. A second one is ignored. - Social sites use the title for share previews unless you add an Open Graph
og:title. - Screen readers announce the title when a page loads, which is another reason to make it specific.
HTML <title> Tag exercises
Name the page
Write a page that the browser tab will show as My First Page. In the body put the paragraph Hello.
Result
