← Home

Base64 Encoder / Decoder

Contact us
Plain Text
Base64 Output

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is defined in RFC 4648 and widely used for embedding binary content in text-based formats.

  • Every 3 bytes of input become 4 Base64 characters
  • Output is padded with = to a multiple of 4 characters
  • ~33% size overhead compared to raw binary

Standard vs URL-safe

Standard Base64 uses + and / which are special characters in URLs. The URL-safe variant (RFC 4648 §5) replaces them with - and _ and omits padding, making it safe to embed in URLs without percent-encoding.

  • Standard: uses + / with = padding
  • URL-safe: uses - _, no padding
  • Used in JWTs, OAuth tokens, and URL parameters

Common uses

  • Email (MIME) — encode binary attachments as ASCII text
  • Data URIs — embed images and fonts inline in HTML/CSS
  • JWTs — header and payload are Base64url-encoded JSON
  • HTTP Basic Auth Authorization: Basic <base64(user:pass)>
  • Cryptography — encode keys, certificates, and signatures