HTML Character Encoding

HTML Character Encoding defines how characters (letters, symbols, emojis) are represented in a web page. The most common encoding is UTF-8, which supports almost all languages and special characters. Setting correct encoding ensures text displays properly across all browsers and devices.

8 views
5 min read
Try It Yourself

Experiment with the code in an interactive editor

What is Character Encoding?

Computers only understand numbers. Character encoding is a system that maps numbers to letters, symbols, and emojis.

Why UTF-8?

UTF-8 is the universal standard that supports EVERY language and emoji.

UTF = Unicode Transformation Format

1-< meta charset="UTF-8">

What you can write with UTF-8:

Language

Example

English

Hello World

Hindi

नमस्ते दुनिया

Spanish

¡Hola Mundo!

French

Bonjour le monde

German

Hallo Welt

Japanese

こんにちは世界

Chinese

你好世界

Arabic

مرحبا بالعالم

Russian

Привет мир

Emojis

😊 🚀 ❤️ 🎉 🔥

What happens without UTF-8:

You see weird boxes: ������� instead of नमस्ते

The Golden Rule:

Always put <meta charset="UTF-8"> as the FIRST tag inside <head>.