{
  "slug": "base64",
  "term": "Base64",
  "aliases": [
    "Base 64",
    "Base64 encoding"
  ],
  "definition": "Base64 is a binary-to-text encoding that represents octets using a 64-symbol alphabet and a protocol-defined padding policy.",
  "note": "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. [base64-rfc]\n\nCanonical 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. [base64-rfc]\n\nValidation: 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. [base64-python] [base64-example]\n\nChecksum 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. [base64-example]",
  "related": [
    "base64url",
    "data-serialization",
    "full-object-checksum",
    "composite-checksum"
  ],
  "citations": [
    {
      "id": "base64-rfc",
      "title": "RFC 4648: Base-N encodings, sections 3-5 and 10",
      "url": "https://www.rfc-editor.org/rfc/rfc4648.html",
      "accessed": "2026-11-21"
    },
    {
      "id": "base64-python",
      "title": "Python 3.12: base64.b64decode and validate",
      "url": "https://docs.python.org/3.12/library/base64.html#base64.b64decode",
      "accessed": "2026-11-21"
    },
    {
      "id": "base64-example",
      "title": "Hesela: Base64 checksum representations and native decoder observations",
      "url": "https://hesela.com/analyses/object-etags-checksums-conditional-writes/#base64-representation",
      "accessed": "2026-11-21"
    }
  ],
  "status": "unknown",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-21",
  "provenance": [
    "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."
  ]
}
