</>
ValidateHTML

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

❌ Invalid
<head>
  <title>My Page</title>
</head>
✓ Valid
<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 Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated HTML on reliable hosting.

Get 80% Off Hosting →

Related HTML Errors

← View all HTML errors