Base64 Encoder/Decoder

Convert text to Base64 and Base64 to text. Useful for encoding and decoding data in web development.

Share this app

Base64 Encoder/Decoder

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is widely used in web development, data transmission, and email.

What is Base64?

Base64 encoding converts binary data into a text string using 64 printable ASCII characters. Each Base64 digit represents 6 bits of binary data.

How It Works

Encoding:

  • Groups bytes into 6-bit sequences
  • Maps each 6-bit value to a Base64 character
  • Adds padding (=) if needed

Decoding:

  • Converts Base64 characters back to 6-bit sequences
  • Reconstructs the original binary data

Common Uses

  • Email attachments - Encoding files for email transmission
  • Data URIs - Embedding images in HTML/CSS
  • Authentication - HTTP Basic Auth headers
  • APIs - Transmitting binary data over JSON
  • Cookies - Storing encoded session data

Formula

Base64 uses this character set (64 characters):

A-Z (0-25), a-z (26-51), 0-9 (52-61), +, / (62-63)

Examples

Input Output
Hello SGVsbG8=
Test123 VGVzdDEyMw==
A QQ==

Tips

  • Every 3 bytes encode to 4 Base64 characters
  • Output length is always a multiple of 4
  • Padding with = indicates incomplete final chunk
  • Base64 URL-safe variant uses - and _ instead of + and /