2025-07-23 — By Siddharth Jain · 6 min read
Meta tags are essential HTML elements placed inside the `` section of a web page. While not visible on the rendered page, they provide important information about the page to browsers, search engines, and other web services. This guide explains all common meta tags and what each does in plain language.
A meta tag in HTML defines metadata—data about the web page itself—such as its character encoding, description, viewport settings, and more. Meta tags let you:
All meta tags are self-closing and added within the `` element:
<head>
<meta name="description" content="A short page summary" />
</head>
Below is a summary table of the most useful and widely adopted meta tags, along with their purpose and usage examples.
| Meta Tag | Purpose | Example Code |
| ------------------------------ | ----------------------------------- | ---------------------------------------------------------------------- |
| <meta charset="UTF-8"> | Sets character encoding | <meta charset="UTF-8"> |
| <meta name="viewport"...> | Responsive page scaling for devices | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="description"...> | Search result summary (SEO) | <meta name="description" content="Free HTML tutorials."> |
| <meta name="keywords"...> | (Legacy) List of page keywords | <meta name="keywords" content="HTML, CSS, tutorials"> |
| <meta name="author"...> | Specifies page author | <meta name="author" content="Siddharth Jain"> |
| <meta name="robots"...> | Search engine crawl instructions | <meta name="robots" content="index, follow"> |
| <meta http-equiv="refresh"...> | Page auto-refresh (or redirect) | <meta http-equiv="refresh" content="30"> |
| <meta property="og:title"...> | Open Graph title (social sharing) | <meta property="og:title" content="My Blog Title"> |
| <meta name="theme-color"...> | Sets mobile browser color | <meta name="theme-color" content="#ffffff"> |
Sets how characters are displayed (e.g., UTF-8 for all languages):
<meta charset="UTF-8" />
Why is it needed?
Ensures all letters, numbers, and symbols appear correctly across devices.
Controls scaling and layout on mobile devices:
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Why is it needed?
Makes your layout responsive, so it fits phones and tablets properly.
Describes the page in search results:
<meta
name="description"
content="Learn HTML meta tags, their types, and roles."
/>
Why is it needed?
A clear description can improve click-through in search engines.
Lists relevant terms for the page (now largely ignored for SEO):
<meta name="keywords" content="HTML, meta tags, SEO" />
Why is it needed?
Used in the past for SEO, now no longer important for search engines like Google.
Specifies the author of the web page:
<meta name="author" content="Siddharth Jain" />
Why is it needed?
Gives credit and helps with documentation.
Gives search engines instructions:
<meta name="robots" content="noindex, nofollow" />
Why is it needed?
Controls if search engines index the page, or follow its links.
Auto-refreshes or redirects after a set time:
<meta http-equiv="refresh" content="5;url=https://example.com/" />
Why is it needed?
Reloads/redirects page, though not recommended for user experience.
Customize social-sharing previews (for Facebook, Twitter, etc.):
<meta property="og:title" content="Amazing Web Guide" />
<meta
property="og:description"
content="Everything you need for web success."
/>
<meta property="og:image" content="https://example.com/cover.jpg" />
Why is it needed?
Controls title, image, and description when shared on social platforms.
Sets browser UI color on mobile devices:
<meta name="theme-color" content="#0099ff" />
Why is it needed?
Improves branding on supported devices and browsers.
<meta http-equiv="Content-Security-Policy" content="default-src 'self'" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="referrer" content="no-referrer" />
<meta name="google-site-verification" content="..." />
All meta tags must be placed inside the `` section of your HTML document:
<!DOCTYPE html>
<html>
<head>
<!-- Meta tags go here -->
</head>
<body>
<!-- Page content -->
</body>
</html>
Meta tags are small pieces of HTML with a big impact on how your web page is seen, shared, and indexed. Keep yours up-to-date for the best visibility and performance!