How does UTF-8 handle languages like Hindi or Chinese?
General knowledgeIn depthAsked by Anonymous23 Oct 2026, 6:59 AM ISTUpdated
In one line
UTF-8 stores every letter, symbol, or character—no matter the language—using a special code that can grow bigger for complex scripts like Hindi or Chinese.
The rule
UTF-8 is a variable-length character encoding for Unicode, using 1 to 4 bytes to represent each character.
A byte is 8 bits (like 8 on/off switches). A character encoding is a way to turn letters and symbols into numbers so computers can store and share them.
Let's understand it simply
Imagine you have a big box of crayons. For English, you only need a few basic colors (like red, blue, green). But for Hindi or Chinese, you need many more colors to draw all the letters and symbols. UTF-8 is like a smart crayon box. For simple letters (A, B, C), it uses just one slot. For more complex letters (like 'अ' in Hindi or '你' in Chinese), it uses extra slots. This way, it can fit every language in the world into one box!
How UTF-8 stores different languages
Character
Unicode code point
UTF-8 bytes
A (English)
U+0041
41
क (Hindi)
U+0915
E0 A4 95
你 (Chinese)
U+4F60
E4 BD A0
How it works
Every character in every language is given a unique number, called a Unicode code point.
UTF-8 takes this number and stores it using 1, 2, 3, or 4 bytes.
Simple English letters (like 'A') use just 1 byte.
Hindi letters (like 'क') or Chinese characters (like '你') use 2, 3, or 4 bytes, depending on their code point.
When you type or read a file, the computer reads these bytes and knows how to turn them back into the right letter or symbol.
How UTF-8 encodes a character
Find the Unicode code point for the character.
Decide how many bytes are needed (1–4).
Break the code point into bytes as per UTF-8 rules.
Store or send these bytes.
When reading, combine the bytes to get the original character.
The story behind it
In the 1980s and 1990s, computers mostly used English. Other languages had trouble because their letters didn't fit in the old systems. Unicode was created to give every letter in every language a unique number. UTF-8 was invented by Ken Thompson and Rob Pike in 1992 to store these numbers efficiently. One fun fact: UTF-8 was designed so that English text would look the same as before, but now you could add any language without breaking old files.
Where you see it in real life
WhatsApp messages: When you send a message in Hindi or Chinese, UTF-8 makes sure the right letters appear on your friend's phone.
Websites: Websites use UTF-8 so people can read them in any language, from Tamil to Russian.
File names: You can save a file as 'मेरा_डॉक्युमेंट.txt' or '我的文件.txt' because UTF-8 supports these letters.
Programming: When you write code that handles text, UTF-8 lets your program work with any language.
SMS and emails: Modern phones and email apps use UTF-8 so you can send messages in any script.
Government forms: Online forms in India use UTF-8 so you can fill them in Hindi, Bengali, or any other language.
Why it matters
Universal communication: Lets people from different countries share information without errors.
Saves space: English text stays small, but other languages fit too.
No more confusion: Old systems would mix up letters; UTF-8 avoids this.
Needed for modern apps: Almost every website, app, and phone uses UTF-8 today.
Worked example
Let's see how UTF-8 stores the Hindi letter 'क' and the Chinese character '你'.