Summary
- RFC 4648 landed in October 2006 on the Standards Track with a modest brief — base 64, base 32 and base 16 — and a long list of things implementers had already broken: "use of line-feeds in encoded data, use of padding in encoded data, use of non-alphabet characters in encoded data, use of different encoding alphabets, and canonical encodings".
- The motive is stated plainly: protocols had used "base64" "without a precise description or reference", and cited MIME for it "without considering the consequences for line-wrapping or non-alphabet characters".
- The load-bearing rule is §3.5: pad bits "MUST be set to zero", because otherwise "there is no canonical representation of base-encoded data, and multiple base-encoded strings can be decoded to the same binary data". That one sentence is what turns an encoding into a function.
Text as a container for bytes
Some channels carry only text. Some payloads are not text. Base64 is the compromise, and it charges a third of the payload for the privilege of surviving a channel that would otherwise chew it up.
The alphabet is the boring part, and everyone knows it. The engineering is in everything around it: whether a newline lands every 64 or 76 characters, whether the trailing = shows up, whether a decoder shrugs at whitespace, and — the one that actually bites — whether two encoders fed the same bytes hand back the same string.
The disagreement is inherited from mail
The document traces the line-length argument to its source: MIME enforces 76 characters, PEM used 64, and "the MIME and PEM limits are both due to limits within SMTP". Two numbers, one cause, both now baked into tooling as if they were properties of the encoding itself.
RFC 4648 settles it by refusing to settle it globally: implementations "MUST NOT add line feeds" unless the referring specification says so. The default is no wrapping, and any wrapping is the caller's business. That is a rare and underrated move in standards — silence is the default, and the exception has to be asked for by name.
Why canonical form is the real subject
A decoder that ignores pad bits maps many strings onto the same bytes. An encoder that leaves pad bits non-zero emits strings that differ where the payload does not — and everything downstream that compares those strings, whether a cache key, a content hash, or a signature over the encoded form, now disagrees about whether two things are the same.
That is the defect RFC 4648 is really about. Not how to encode, but how to make encoding a function rather than a relation, so that equality survives a round trip.
The pad-bit rule is a deterministic validation rule in the only sense that matters: any decoder can check it locally, with no committee, no register of approved encoders, and no appeal to authority. Either the low bits are zero or the string is not canonical. That is what makes it enforceable at scale — and what lets it survive twenty years of implementations that never read the RFC.
Base64 is not secrecy, and the document knew
Base64 hides nothing. It makes binary legible to text tools, and the one-third overhead is the visible price of admission. The misuse is familiar: strings that look scrambled get treated as if scrambling were protection.
The specification does not lecture. It simply refuses to call the output anything but an encoding, and leaves the confusion to everyone who kept using base64 as a hiding place.
A standard about equality
RFC 4648 is a short document with an unusual centre of gravity. It standardises an alphabet everyone was already using, then spends the rest of its length defining when two encodings count as the same.
That is the useful kind of standardisation. The alphabet was never the hard part; agreement about identity is. Specify only what must be common, make it checkable by anyone holding a decoder, and leave the rest to whoever is holding the socket.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






