Visual RFC.
ALL RFCs / RFC 3629
Read the RFC ↗
RFC 3629 / MECHANISM GUIDE

Variable-length encoding

01

UTF-8 encodes Unicode values with a leading byte and continuation bytes.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

DIAGRAM§ 3 ↗
RFC 3629 · § 3EXAMPLE
3 / 3
Variable-length encodingUTF-8 encodes Unicode values with a leading byte and continuation bytes.Variable-length encoding€ · U+20ACE282AC1110xxxx 10xxxxxx 10xxxxxxLeading byte + two continuation bytes
03
Read byte roles

E2 82 AC has one leading byte and two continuation bytes.

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
WHAT CHANGED
RFC 2279RFC 3629 §12

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 ↗
KEY POINT

ASCII values use one byte with the high bit clear.

  • 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.
DETAILS

Examples are illustrative. Consult the linked RFC and its errata for implementation details.

Read the RFC section ↗

Diagrams simplify the RFC. Read the linked sections for complete requirements.

Privacy
All chapters in this RFC
  1. Variable-length encoding
  2. Pack a code point
  3. Validate byte sequences
  4. Byte-order mark
  5. Text comparison and security
RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗