Can a reader simply ignore unexpected marks?
05A reader needs an explicit rule for odd symbols, extra ending marks and unused bits. Guessing can make readers disagree.
The visible line-break label stands for a real LF byte in this example.
These are text symbols representing data.
What happens if you change this?
Make one change, then watch again. Restart restores the original example.
Write the agreed alphabet, zero pad bits, and required padding.
Key idea: A decoder’s exceptions must come from the containing format. Acceptance does not excuse a broken encoder or prove trust.
Terms
- Base encoding
- A reversible way to represent bytes with a selected alphabet of text symbols. It is not encryption.
- Alphabet
- The agreed dictionary of symbols. Base64 and Base64url use different alphabets.
- Byte / bit
- One byte contains eight on-or-off values called bits.
- Padding / pad bits
- Equals-sign ending marks / zero filling bits inside the final data symbol. They are different things.
- Profile
- The containing format’s explicit extra rules, such as whether padding is omitted.
- Canonical form
- A specified consistent spelling. Being decodable does not guarantee that spelling.
Rules & examples
A decoder’s exceptions must come from the containing format. Acceptance does not excuse a broken encoder or prove trust.
- Do not add line feeds unless a referring specification requires them.
- Reject non-alphabet characters unless the referring specification explicitly allows another policy.
- Use canonical output to avoid several spellings for the same bytes.
Examples are illustrative. Consult the linked RFC and its errata for implementation details.
RFC 4648 §§3.1–3.5. MUST NOT add line feeds without referring instructions; MUST reject non-alphabet input by default. A referring specification can choose exceptions. This bounded liberal profile ignores only CR/LF and excess trailing =, not interior = or !. Nonzero pad-bit rejection is a decoder MAY; zero pad bits are an encoder MUST. Selected text "Zm8=".
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.