UTF-8 is the encoding that turns the world’s text — every language, every emoji — into bytes. It is the default on the web, in this site’s binary code translator, and almost everywhere else. Here is how it works, what it costs, and when you actually need to think about it.
The Problem: One Byte Is Not Enough
ASCII covered English with values 0–127, one byte per character. But one byte only holds 256 values, and the world has far more characters than that — Chinese alone has tens of thousands. Unicode assigns every character a unique code point (H is U+0048, 你 is U+4F60, 👋 is U+1F44B), and UTF-8 is the clever scheme that stores those code points in bytes.
How UTF-8 Works
UTF-8 is a variable-length encoding: small code points take few bytes, large ones take more. The first bits of each byte announce the pattern — a byte starting with 0 is a complete one-byte character, 110 starts a two-byte sequence, 1110 starts three, 11110 starts four — and every continuation byte starts with 10, so a decoder can never confuse a continuation for a start.
- 1 byte — code points 0–127: plain English, identical to ASCII. H =
01001000. - 2 bytes — most European and Middle Eastern letters.
- 3 bytes — Chinese, Japanese and Korean characters. 你 =
11100100 10111101 10100000. - 4 bytes — emoji and rare symbols. 👋 =
11110000 10011111 10010001 10001011(hex F0 9F 91 8B).
The Pros: Why UTF-8 Won
- ASCII compatibility — plain English text is byte-for-byte identical to ASCII, so decades of old systems and files kept working without conversion.
- Self-synchronizing — the leading-bit pattern means a decoder that lands mid-string can skip forward to the next start byte without corrupting the rest of the text.
- Universal coverage — every Unicode code point encodes, from ASCII to 你 to the newest emoji, in one scheme.
The Trade-offs
Variable length has a price. You cannot jump straight to the 100th character of a UTF-8 string without scanning from the start, because characters occupy different numbers of bytes. Chinese and Japanese text costs 3 bytes per character where UTF-16 would use 2, and emoji always cost 4. Decoders must also validate input — a lone continuation byte or a truncated sequence is an error, not a character.
Who Needs to Care (and Who Doesn’t)
If you ever decode binary messages, debug mojibake, or work with text files from different systems, UTF-8 is worth understanding — it explains both why “Hi” is 2 bytes and why 👋 is 4. If you only ever convert short English messages, you can treat it as the invisible default and never think about it again.
Step-by-Step: Watch an Emoji Become Bytes
- Open the binary code translator and type 👋 into the input.
- The tool detects text and converts with UTF-8:
11110000 10011111 10010001 10001011— four bytes. - Open Explain This Result to see the character mapped to code point U+1F44B with hex F0 9F 91 8B.
- Now type a plain English word and compare: one byte per letter, exactly like ASCII.
UTF-8 vs UTF-16
UTF-16 uses at least 2 bytes per character and shows up inside Windows, Java and JavaScript. For everything pasted from chats or websites, UTF-8 is almost always the right choice — which is why it is the default here and UTF-16 lives in Advanced settings.
Practice
1. How many bytes does “你好” take in UTF-8? Each Chinese character takes 3 bytes: 2 × 3 = 6 bytes (11100100 10111101 10100000 11100101 10100101 10111101).
2. Is a plain ASCII text file already valid UTF-8? Yes — ASCII bytes 0–127 are identical in UTF-8, so every pure-ASCII file is a valid UTF-8 file with zero conversion.
Frequently Asked Questions
Is UTF-8 the same thing as Unicode?
No. Unicode is the character set — the giant table assigning a code point to every character. UTF-8 is one encoding of that table: the rule for turning code points into bytes. UTF-16 and UTF-32 are other encodings of the same table.
Why do I sometimes see � or strange characters?
That is mojibake: UTF-8 bytes decoded as if they were a single-byte encoding like Latin-1, or a truncated multi-byte sequence replaced by the replacement character. The bytes are usually fine — the decoding was wrong.
Does UTF-8 really cover every language?
Yes. Unicode assigns code points to over 150,000 characters across more than 160 writing systems, and UTF-8 can encode every one of them — including characters added in future Unicode versions.