Character Encoding & Entities
10 min read
UTF-8HTML EntitiesUnicodeEncoding DeclarationEmoji
Character Encoding: Making Text Work Everywhere
Character encoding defines how bytes map to characters. The web standard is UTF-8, supporting every character in every language plus emoji.
Why UTF-8 Matters
- ASCII (old): Only 128 characters (English letters, numbers, basic punctuation)
- Latin-1/ISO-8859-1: 256 characters (Western European languages)
- UTF-8: 1,112,064 possible characters (every language, symbols, emoji)
HTML Entities
Some characters have special meaning in HTML. Use entities to display them:
| Character | Entity | Numeric |
|---|---|---|
| < | < | < |
| > | > | > |
| & | & | & |
| " | " | " |
| Non-breaking space | |   |
| © | © | © |
Encoding Declaration Order
The charset declaration MUST be within the first 1024 bytes of the document. Place it as the very first element inside <head>.