Best Practices Small
Declare a character encoding
Declaring <meta charset="utf-8"> tells the browser exactly how to interpret the bytes of the page before it starts parsing content. Without an early, correct charset declaration, browsers have to guess, and a wrong guess turns accented characters, quotation marks, or symbols into visibly garbled text (mojibake).
Why it matters
Without a declared charset, browsers may guess the encoding incorrectly, causing special characters, accents, or symbols to render as garbled text.
How to fix
- 1 Add <meta charset="utf-8"> within the first 1024 bytes of <head>, so browsers see it before parsing any non-ASCII content.
- 2 Confirm the file is actually saved/served as UTF-8 so the declared encoding matches the real one and characters don't come out garbled.
Common mistakes
- Placing the charset meta tag too late in <head>, after content that could already have been parsed with the wrong assumed encoding.
- Declaring UTF-8 in the HTML but actually saving/serving the file in a different encoding (like Windows-1252), so the declaration and the real bytes disagree.
- Relying on the HTTP Content-Type header to declare the charset while the HTML meta tag says something different, creating a conflicting signal.
How to verify
- 1 View page source and confirm a <meta charset="utf-8"> declaration is present in <head>. Place it as early as possible, within the first 1024 bytes, so browsers see it before parsing any non-ASCII content: this scan looks for the declaration, not for how far into the document it sits.
- 2 Check that the file is actually saved and served as UTF-8 (e.g. via the Content-Type response header) to confirm it matches the declaration. A charset parameter on that header counts as a declaration on its own, and this scan accepts it.
- 3 Look for garbled special characters (accents, curly quotes, em dashes) anywhere on the page as a quick visual check.
Related checks
Ready to see where you stand?
Scan your site and get your Engineering Score with a prioritized roadmap in under a minute, no signup required.
EngineeringScore