RFC 4648 / START HERE
Base encodings, before the details
Base16, Base32, and Base64 encodings
These encodings represent bytes using restricted sets of text characters. They make binary data easier to carry in text-oriented systems.
The idea in one picture
Binary bytes need transport
An encoding writes safe characters
A decoder recovers the bytes
A simplified picture of the idea; the chapters explain the actual mechanisms.
Why it exists
Some systems cannot safely carry arbitrary bytes as text. Encoding changes the representation; it does not encrypt or hide the data.
A familiar example
An email attachment's bytes can be represented as Base64 text for transport inside a message.
Helpful background
You can start here without reading another RFC. The guide introduces its essential concepts as you go.
What you’ll learn next
Begin with chapter one, or choose a topic.
- Base64 bit groupsThree input bytes become four six-bit alphabet indices.→
- Padding and pad bitsA short final group uses zero pad bits and, unless specified otherwise, equals-sign padding.→
- Base64url alphabetThe URL-safe alphabet changes two symbols without changing the six-bit grouping.→
- Base32 and Base16Different group sizes create different alphabets and expansion ratios.→
- Strictness and canonical formA consuming protocol must say when to tolerate non-alphabet characters or line breaks.→
This introduction explains RFC 4648 (2006). Read the original RFC ↗