What Is the Maximum Length of HTML Meta Tags?
HTML meta tags have no universal maximum. Learn the difference between source length, search display limits, and Google’s snippet controls.
There is no universal maximum length for HTML meta tags. The answer depends on which field you mean, who consumes it, and whether you are asking about the value in the HTML source or the text shown in a search result.
For the two SEO fields developers usually mean:
- Google says there is no fixed length limit for a
<meta name="description">value. - Google says there is no fixed length limit for the
<title>element. - Google may shorten either value when displaying a search result.
- The
max-snippetrobots directive can request a maximum preview length, but it does not limit the source value.
Character counts such as 150–160 characters for descriptions or around 50–60 characters for titles are publishing conventions intended to reduce display truncation. They are not HTML limits and do not guarantee what Google will show.
Source length and displayed length are different
HTML stores the metadata value in the document. A search engine then decides whether to use it, how much to display, and whether to replace it with text from the page. These are separate stages:
- Your server returns the HTML document.
- The crawler reads valid metadata in the document head.
- The search engine selects a title link and snippet for a query and device.
- The result may be shortened to fit the available display width.
Therefore, a 300-character description can be valid HTML even if only part of it appears in a search result. Google’s documentation says descriptions are truncated as needed, typically to fit the device width. See Google’s meta-description guidance.
How long can a meta description be?
There is no maximum length imposed by Google for the content attribute of a meta description. A valid example is:
<head>
<meta name="description" content="A detailed description of this page can be longer than the text shown in a search result. Google decides how much of it to display.">
</head>
Use a concise, page-specific summary anyway. Google may use the description when it considers it a better explanation than visible page text, and it recommends distinct descriptions for different pages. A long description is not a way to force more words into the snippet.
| Question | Answer |
|---|---|
| Maximum source length | No fixed Google limit. |
| Guaranteed displayed length | None. The snippet can be shortened or rewritten. |
| Practical writing target | Describe the page in one or two useful sentences; keep the most important information early. |
How long can a title element be?
Google also states that there is no length limit for the HTML <title> element. The title link shown in Search may still be truncated to fit the device width, and Google can construct the title link from other page content when it believes that produces a better result. The official guidance is in Google’s title-link documentation.
<head>
<title>What Is the Maximum Length of HTML Meta Tags? A Developer Guide</title>
</head>
Write a descriptive title that identifies the page’s subject. Avoid repeating boilerplate, stuffing keywords, or adding words that do not help a reader decide whether to open the result.
Can you control the length of Google’s snippet?
Use the max-snippet value in a robots directive when you need to request a maximum number of characters for a textual preview:
<meta name="robots" content="max-snippet:160">
Special values have defined meanings:
| Value | Meaning |
|---|---|
max-snippet:160 |
Requests that the text snippet be limited to 160 characters. |
max-snippet:0 |
Suppresses the text snippet. |
max-snippet:-1 |
Leaves the length to Google’s choice. |
This directive controls a search preview, not the underlying meta description string. Google must be able to crawl the page to read the directive. Details are in Google’s robots meta-tag specification.
What counts as a meta tag?
“Meta tag” describes many different elements and directives. They do not share one length rule.
| Element or directive | Purpose | Length answer |
|---|---|---|
<title> |
Document title and possible search title link | No fixed Google limit; display may be truncated. |
meta name="description" |
Candidate search-result description | No fixed Google limit; display may be truncated or replaced. |
meta name="robots" content="max-snippet:N" |
Requested maximum textual preview | The number applies to the preview directive, not source metadata. |
meta name="keywords" |
Legacy keyword list | Google does not use it for Search indexing or ranking. |
| Open Graph and social metadata | Controls previews on other platforms | Follow the consuming platform’s documentation. |
Google warns that invalid elements or markup in the document head can interfere with how metadata is read. Keep title and meta elements in valid HTML and inside <head>. See Google’s valid-page-metadata guidance.
A complete HTML example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Maximum HTML Meta Tag Length: Practical Rules</title>
<meta name="description" content="Learn which HTML metadata fields have limits, how Google truncates search previews, and how max-snippet affects displayed text.">
<meta name="robots" content="index,follow,max-snippet:160">
</head>
<body>
<h1>Maximum HTML Meta Tag Length</h1>
</body>
</html>
Testing metadata without confusing source and preview
- View the raw HTML response and confirm the title and meta description exist.
- Inspect the live DOM to ensure client-side code has not removed or replaced them.
- Validate that metadata is inside
<head>and that the head contains valid markup. - Check that crawlers can access the page and are not blocked by authentication or robots rules.
- Use a search preview as an observation, not a guarantee: Google can rewrite or truncate the result for different queries and devices.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| The description is ignored | Google found page text more useful for the query, or the description is generic. | Write a specific summary of that page and make the opening visible text match its subject. |
The title shown in Search differs from <title> |
Google generated a title link from another page signal. | Use a concise descriptive title, remove boilerplate, and keep headings aligned with it. |
| Metadata is missing in crawled HTML | It is injected only after JavaScript runs, or the response is different for crawlers. | Render the required tags in the server response when possible, then inspect the raw response. |
max-snippet has no visible effect |
The page is not crawlable, the directive is malformed, or the result has not been refreshed. | Verify access and syntax, then allow time for recrawling; the directive is a request about previews. |
| Tags are ignored unpredictably | Invalid markup appears in the document head. | Validate the HTML and keep metadata elements in their permitted location. |
Performance, reliability and cost considerations
Metadata itself adds negligible response size. The meaningful performance risks come from putting it behind client-side rendering, serving different HTML to crawlers, or delaying the document head until scripts run. Emit the canonical title and description in the initial response, keep them stable across requests, and avoid generating thousands of duplicate descriptions.
There is no API cost for writing these tags. The operational cost is validation and recrawling: changes may not appear in search immediately, and a displayed snippet remains query- and device-dependent.
Or skip the browser setup
If you need a rendered capture of a page while reviewing how its metadata changes the visible document, ScreenshotNeo provides a website screenshot API and MCP server. It accepts one GET request and returns PNG, JPEG, WebP or PDF output. Cookie and consent banners, newsletter popups and chat widgets are removed before capture. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
See the ScreenshotNeo API documentation for all options.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/meta-test -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/meta-test"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/meta-test' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
An MCP server lets AI agents such as Claude, Cursor and other MCP clients take screenshots with take_screenshot, inspect pages with get_page_info and create PDFs with capture_pdf. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
FAQ
Is 160 characters the maximum for a meta description?
No. It is a common writing target, not an HTML or Google maximum.
Does a longer title improve ranking?
No length alone does not provide a ranking guarantee. Make the title descriptive, concise and relevant to the page.
Can CSS or JavaScript change a meta tag’s maximum?
No. They can change which value is present at runtime, but they do not create a universal length limit.
Does max-snippet limit social-media previews?
It is a Google robots directive for textual search previews. Other platforms may use their own metadata and rules.
Should every page use a unique description?
Distinct, page-specific descriptions are preferable when practical because they help explain each URL’s content.


