The page title is the short text that appears on the browser tab, in search engine results (Google title), and when a page is bookmarked by a user. It helps both users and search engines understand what your page is about.
In HTML, the page title is defined using the <title> tag, which is written inside the <head> section of your document.
The title tag is very simple,
<title>Your Page Title Here</title>
- <title> – Defines the title of the webpage
- Text between tags – The actual title displayed in the browser tab
- Location – Must be placed inside the <head> tag
A valid HTML document must contain a <title> tag. Without it, the page is considered incomplete or “untitled” by browsers.
Example of Basic Page Title
<!DOCTYPE html>
<html>
<head>
<title>HTML Page Title Example</title>
</head>
<body>
<h2>Welcome to My First HTML Page</h2>
<p>This page demonstrates how to set a title in HTML.</p>
</body>
</html>
When you open this page in your browser, you’ll see the text “HTML Page Title Example” written on the browser tab.
Tip: The page title does not appear in the webpage body it only shows up in the browser tab and search engine preview.