Back to Tools

Base64 Encoder/Decoder

Encode and decode Base64 strings, files, and images. All processing happens locally in your browser.

Security Note: Base64 is an encoding, not encryption. Anyone can decode Base64 data. Never use it to protect sensitive information.

Understanding Base64

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters. It converts binary data into a format that can be safely transmitted over text-based protocols.

Base64 Alphabet

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

URL-safe variant uses - and _ instead of + and /

How It Works

Base64 encoding converts every 3 bytes (24 bits) of binary data into 4 ASCII characters (6 bits each). This means encoded data is always about 33% larger than the original.

Original:Man(3 bytes)
Binary:01001101 01100001 01101110
Base64:TWFu(4 characters)

Common Use Cases

  • Data URIs: Embedding images directly in HTML/CSS
  • Email Attachments: MIME encoding for binary files
  • JSON/XML: Transmitting binary data in text-based formats
  • JWT Tokens: URL-safe encoding for authentication tokens
  • Certificates: PEM format for SSL/TLS certificates
  • APIs: Sending binary data through REST endpoints

Padding with "="

Since Base64 encodes 3 bytes at a time, padding is needed when the input length isn't divisible by 3:

  • 1 byte input: 2 characters + ==
  • 2 bytes input: 3 characters + =
  • 3 bytes input: 4 characters (no padding)

URL-safe Base64 often omits padding since the length can be calculated.

Size Increase

Base64 encoding increases data size by approximately 33-37%:

1 KB~1.37 KB
100 KB~137 KB
1 MB~1.37 MB

Consider this overhead when embedding large files.

Security Warning

Base64 is NOT encryption! It's simply a different representation of the same data. Anyone can decode Base64 instantly.

  • Never use Base64 to "hide" passwords
  • Never assume Base64 data is secure
  • Never transmit sensitive data in Base64 over insecure channels

For actual security, use proper encryption (AES, RSA) or secure hashing (bcrypt, Argon2).