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

Can a reader simply ignore unexpected marks?

05

A reader needs an explicit rule for odd symbols, extra ending marks and unused bits. Guessing can make readers disagree.

RFC 4648 · § 3.3EXAMPLE
1 / 4 · Inspect exactly what arrived

The visible line-break label stands for a real LF byte in this example.

Received representationZm8=

These are text symbols representing data.

What happens if you change this?

Make one change, then watch again. Restart restores the original example.

3 / 3
03
Emit canonical text

Write the agreed alphabet, zero pad bits, and required padding.

Can a reader simply ignore unexpected marks?A reader needs an explicit rule for odd symbols, extra ending marks and unused bits. Guessing can make readers disagree.Can a reader simply ignore unexpected marks?Input: TQ=!=alphabet gateTQ==Canonical encoder output for M

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.

Look up a term in the glossary ↗

Rules & examples
  • 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
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

All chapters in RFC 4648

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

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

RFC status and corrections ↗