Skip to main content
HTML Validation

Bad value “text/html;” for attribute “content” on element “meta”: The legacy encoding declaration ended prematurely.

About This HTML Issue

The content attribute of a <meta http-equiv="Content-Type"> tag ends at text/html;, with no character encoding after the semicolon.

With http-equiv="Content-Type", the <meta> element is an encoding declaration, and the HTML standard allows one shape for its content: text/html;, optional spaces, then charset=utf-8. The validator reads text/html;, hits the end of the value right after the semicolon, and reports that the declaration ended too early. Values cut off later get different messages: text/html; charset is reported as missing charset=, and text/html; charset= as an empty encoding name.

Browsers take an encoding from this tag only when they find charset= in it, so a bare text/html; does nothing. If the server's Content-Type header has no charset either, the browser falls back to its own default, and accented letters or symbols can come out garbled.

Add charset=utf-8 after the semicolon, or swap the tag for the shorter <meta charset="utf-8">, which declares the same thing. Keep only one of the two forms in the document. The file itself also has to be saved as UTF-8.

Invalid example

<head>
  <meta http-equiv="Content-Type" content="text/html;">
  <title>Products</title>
</head>

Valid example

<head>
  <meta charset="utf-8">
  <title>Products</title>
</head>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries