Base64 Encoder & Decoder

What is Base64?

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. It is commonly used to embed images directly into HTML or CSS.

Free Base64 Encoder & Decoder

Convert text and binary data into safe ASCII strings. Perfect for email attachments, data URIs, and API headers.

Safe Transfer

Ensures binary data remains intact during transfer over protocols designed for text (like HTTP/SMTP).

Instant Decode

Decode cryptic `SGVsbG8=` strings back into readable text in milliseconds.

Data URIs

Embed small images directly into HTML/CSS to reduce HTTP requests and speed up page loads.

How Base64 Works

Base64 encoding takes binary data and translates it into a simplified alphabet of 64 characters (A-Z, a-z, 0-9, +, /).

  • Binary to Text

    It turns bytes that might break text systems (like null bytes) into safe printable characters.

  • Basic Authentication

    Standard HTTP Authentication headers use Base64 to encode `username:password`.

  • MIME

    Email attachments are encoded in Base64 so they can travel through text-only email servers.

Technical Details

The Algorithm

Base64 encoding breaks binary data into 6-bit segments. Each 6-bit segment represents a value between 0 and 63, which maps directly to a character in the Base64 alphabet.

For example, three 8-bit bytes (24 bits total) are converted into four 6-bit groups (24 bits total). This is why Base64 output is always longer than the input.

Padding with "="

Since the output must be a multiple of 4 characters, padding characters (`=`) are added to the end if the input length isn't divisible by 3.

  • 1 byte remaining → 2 padding characters (`==`)
  • 2 bytes remaining → 1 padding character (`=`)

Data Overhead

Base64 encoding increases data size by approximately 33%. A 10MB file will become roughly 13.3MB when encoded. This is the trade-off for safe text transmission.

How to use

1

Paste Input

Enter your plain text or Base64 string into the input box.

2

Select Action

Click "Encode" to convert text to Base64, or "Decode" to convert back.

3

Copy Result

Your result appears instantly. Click "Copy" to save it.