How can a symbol fit into small computer pieces?
01A computer stores numbers in small pieces called bytes. Different text items need different numbers of pieces.
We want another computer to read this same item.
What happens if you change this?
Make one change, then watch again. Restart restores the original example.
E2 82 AC has one leading byte and two continuation bytes.
Key idea: One text item can need several bytes. Counting bytes is different from counting what you see.
Terms
- UTF-8
- A rule for turning Unicode character numbers into ordered bytes, and back.
- Code point
- A character number in Unicode. A scalar value excludes reserved surrogate numbers.
- Byte / bit
- A byte is eight bits. A bit has one of two values: zero or one.
- Leading / continuation byte
- The first piece tells the reader how many bytes belong together. Following pieces start with the bits 10.
- Normalization
- A specified way to transform Unicode text before comparison. It does not turn every lookalike into the same letter.
- BOM
- A contextual initial encoding signature. UTF-8 never uses it to switch byte order.
Rules & examples
One text item can need several bytes. Counting bytes is different from counting what you see.
- ASCII values use one byte with the high bit clear.
- Other scalar values use two, three, or four bytes.
- Continuation bytes begin with 10 in binary.
Examples are illustrative. Consult the linked RFC and its errata for implementation details.
RFC 3629 §3. U+20AC → E2 82 AC. A byte is eight bits. These examples each contain one Unicode scalar value; a visible symbol can contain several code points. ASCII uses one byte; modern UTF-8 never uses five or six.
Sources
New to this? Start hereA quick picture + helpful background
First, agree how to read the message.
An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.
Start with this guide; no earlier guide is needed for the overview.
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
The revision restricts UTF-8 to U+0000–U+10FFFF and makes rejection of invalid sequences normative; the resulting maximum is four bytes.
Read the updated RFC section ↗