Charset declaration

What is charset declaration encoding?

Seo main factors

Charset declaration

How do browsers and servers communicate effectively?

Thanks to a large amount of bytes of data that is exchanged by them.

Like every kind of interaction, the “language” must be declared in order to understand each other: in this case, we do not have a language but a character encoding format.

The server sends to the browser an HTML file in which it is strongly recommended to declare the character encoding format: if it does not, the browser will not be able to decode the bytes inside the file.

Where should I declare my charset?

<meta charset> element should be fully contained in the top of the document, ideally within its first 1024 bytes.

How the SeoChecker charset audit fails

If the scanned page does not declare or declare the character encoding too late, SeoChecker will display an error:

How can I solve the issue?

There are 3 possible practices to do it correctly:

  • insert a BOM (byte-order mark)
  • in your HTML, insert a <meta charset> element within the first 1024 bytes
    <!DOCTYPE html>
    <html lang="en">
     <head>
       <meta charset="UTF-8">
       …
  • add a Content-Type HTTP response header: it must contain a charset directive
    Content-Type: text/html; charset=UTF-8

Share this Guide

Did you like it? Share it!

Share this tool

Web tools for modern developers. Try these one!

Over 50 generators, builders and validators to improve your SEO and web performances

Home Back to top of the page