Skip to content
BENIBIX Learn

8-bit Unicode Transformation Format (UTF-8)

Development📄 Files & FormatsText

Also known as UTF-8, UTF8

The code that nearly all sites use. It has each language and emoji.

Think of it like

Think of it like one code book for every land. It has all their letters, and emoji too.

Example

Emma's shop shows names in English, Persian and Greek on one page. Because the page is UTF-8, every name looks right.

Why it matters

With UTF-8 in all places, names, signs and every language just work.

Definition

UTF-8 is the character encoding used by almost every web page and modern system. It can store every letter of every language, plus emoji. Plain English letters take 1 byte each, so old English text is still valid. Other letters take 2, 3 or 4 bytes. If you are asked to pick an encoding, UTF-8 is the safe answer.

Example code

python
print(len("A".encode("utf-8")))   # 1
print(len("é".encode("utf-8")))   # 2
print(len("😀".encode("utf-8")))  # 4
Simple letters take 1 byte; others take more.

Common mistake

Counting text length in bytes. A word with é or emoji has more bytes than letters.

Key takeaways

  1. 1
    Every language. Plus emoji and symbols.
  2. 2
    1 to 4 bytes. English letters stay at 1.
  3. 3
    The safe default. Pick it unless told otherwise.

Compare

Learn it properly