Missing Charset Declaration
The charset declaration tells the browser how to decode the bytes of your HTML file into characters. Without it, the browser guesses — and may guess wrong, turning special characters (accents, emojis, symbols) into garbled text (mojibake).
Why It Matters
Missing charset can cause text to display incorrectly: accented characters (é, ñ, ü) show as garbage, emoji break, and currency symbols appear wrong. UTF-8 covers virtually all characters in all languages.
Code Examples
<head> <title>My Page</title> </head>
<head> <meta charset="UTF-8"> <title>My Page</title> </head>
How to Fix
- 1Add <meta charset="UTF-8"> as the first element inside <head>.
- 2It must appear within the first 1024 bytes of the document.
- 3Ensure your file is actually saved as UTF-8 (check your editor's encoding settings).
- 4UTF-8 is the only charset you should use in 2026 — it supports all languages and emoji.
Check Your HTML Now
Our validator detects this error automatically and shows the exact line number.
Open HTML ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated HTML on reliable hosting.
Related HTML Errors
Missing DOCTYPE Declaration
Learn why <!DOCTYPE html> is required and what happens when it's missing. Fix quirks mode rendering issues.
Missing Lang Attribute
Learn why the lang attribute on the html element is critical for screen readers, translations, and SEO.
Missing Viewport Meta Tag
Why the viewport meta tag is essential for responsive design. Fix mobile rendering issues with the correct viewport configuration.