base64 · also Base 64, Base64 encoding

Base64

Base64 is a binary-to-text encoding that represents octets using a 64-symbol alphabet and a protocol-defined padding policy.

Mechanism: Three input bytes become four alphabet symbols; an incomplete final group uses unused zero bits and, in the padded form, one or two equals signs. Encoding does not compress, encrypt or authenticate the bytes. [1]

Canonical spelling: Nonzero unused bits can produce different text that decodes to the same bytes. RFC 4648 requires conforming encoders to zero them, but permits decoders to reject them rather than universally requiring rejection. [1]

Validation: In the recorded Python 3.12.3 and Node v24.22.2 examples, both Zg== and Zh== decode to byte 0x66, although only Zg== is the canonical padded spelling. Python validate=True checks alphabet and padding, not canonical pad bits. [2] [3]

Checksum use: Keep the checksum algorithm, covered bytes and representation together. A part-count suffix is outside Base64; changing its encoding does not change the checksum's scope. Validate the enclosing format before comparing decoded digest bytes. [3]

Relations

related
Base64url, Data serialization, Full-object checksum, Composite checksum

Citations

  1. RFC 4648: Base-N encodings, sections 3-5 and 10 (accessed 2026-11-21)
  2. Python 3.12: base64.b64decode and validate (accessed 2026-11-21)
  3. Hesela: Base64 checksum representations and native decoder observations (accessed 2026-11-21)
Sources & caveats
  • Source synthesis with deterministic native decoder examples, not an object-store acceptance test.
  • The canonical padded profile in the example deliberately rejects ignored characters and nonzero pad bits; other protocols can specify different decoder policies.

JSON: /data/terms/base64.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Base64. Hesela. 2026-11-21. https://hesela.dev/terms/base64/