Warning Charset declaration — missing or too late
Why <meta charset="UTF-8"> must appear near the top of <head>, and what happens when a browser guesses the encoding wrong.
The validator checks for a <meta charset> tag and, when present, that it appears within the first 1024 bytes of the document (missing-charset / late-charset).
Example
<head>
<meta charset="UTF-8">
<title>Page title</title>
...
</head>It needs to be one of the first things inside <head>, before any element that could contain non-ASCII text (like <title>).
Why it matters
A browser has to start rendering before it has downloaded the whole page, so it needs to know the character encoding immediately to interpret the bytes correctly. The HTML spec requires the charset declaration to be fully contained within the first 1024 bytes for exactly this reason — if it comes later, the browser may have already started parsing with a guessed encoding, and re-parsing from scratch to correct it wastes time and can briefly flash mis-decoded text (accented characters and symbols turning into garbled boxes or question marks).
Frequently asked questions
Is UTF-8 the only valid value?
For the short <meta charset="..."> form, the HTML spec requires the value to be an ASCII case-insensitive match for "utf-8" — no other encoding is permitted here. UTF-8 also covers virtually every character needed for any language, so there's no practical reason to use anything else.
Can I put the charset tag anywhere in <head>?
It needs to be within the first 1024 bytes of the document and before any element likely to contain text content, like <title>. Putting it as the very first child of <head> is the safest choice.