What is Base64?

Base64 is a binary-to-text encoding scheme that represents arbitrary binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /). It is used to safely embed or transmit binary data — like images or files — through systems that only handle text, such as JSON, email (MIME), and data URIs.

Base64 is encoding, not encryption: anyone can decode it instantly, so it provides no security. Encoded output is about 33% larger than the original data.

Key points

  • Every 3 bytes of input become 4 Base64 characters, so the output is ~33% larger.
  • The alphabet is A–Z, a–z, 0–9, + and /, with = used for padding.
  • It is fully reversible by anyone — Base64 is encoding, not encryption.
  • Base64URL is a variant that swaps + and / for - and _ so the result is URL-safe.

Example

Text:   Hi!
Base64: SGkh

Common uses

  • Embedding small images or fonts directly in CSS/HTML as data URIs
  • Encoding binary attachments in email (MIME)
  • Carrying binary data inside JSON or XML payloads
  • The three segments of a JWT are Base64URL-encoded

Work with Base64 directly in your browser.

Open the Base64 Encoder/Decoder

More terms