Skip to main content
HTML Validation

A “charset” attribute on a “meta” element found after the first 1024 bytes.

About This HTML Issue

The <meta charset> is expected to appear at the beginning of the document, within the first 1024 bytes. Consider moving it to the beginning of the <head> section, as in this example:

<head>
  <meta charset="utf-8">
  ...
</head>

A character encoding declaration is a mechanism by which the character encoding used to store or transmit a document is specified. For HTML documents, the standard way to declare a document character encoding is by including a <meta> tag with a charset attribute, typically <meta charset="utf-8">.

According to the W3C standard:

The element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document.

Learn more:

Last reviewed: October 27, 2022

Was this guide helpful?

Find issues like this automatically

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

Ready to validate your sites?
Start your free trial today.