S3Softs

Base64 Encoder & Decoder

Convert human-readable text strings into Base64 format, or decode Base64 strings back into human-readable text. Base64 is commonly used by developers to transmit binary data over text-based protocols like HTTP and within URLs.

Click to upload or drag and drop

.txt .md .json .html .csv .xml .b64

The Mathematics Behind It

1. Base64 Mathematics (Encoding)

Base64 encoding mathematically shifts data between different bases. It translates binary data (base-2) into a 64-character text alphabet (base-64).

1. Take 3 ASCII characters (3 bytes = 24 bits)
2. Split the 24 bits into four 6-bit groups.
3. Translate each 6-bit group into a single decimal integer (0 to 63).
4. Map the integer to the Base64 Index Table (A-Z, a-z, 0-9, +, /).
5. If the original text is not a multiple of 3, pad the output with "=" signs.

2. Base64 Mathematics (Decoding)

1. Reverse the process: Take the 4 Base64 characters.
2. Map each character back to its 6-bit binary representation.
3. Combine the four 6-bit blocks into 24 bits (3 bytes).
4. Convert the three 8-bit bytes back into standard ASCII characters.
5. Ignore padding "=" characters at the end.

Frequently Asked Questions

Is Base64 considered encryption?

No. Base64 is an encoding scheme, not an encryption method. It provides no security or cryptographic protection. Anyone with a Base64 decoder can immediately read the original text.

Why use Base64?

Base64 is used to encode binary data (like images or compiled files) into an ASCII string format. This ensures the data remains intact without modification during transport across readable text networks like email attachments (MIME) or JSON APIs.

What does the '=' mean at the end of a Base64 string?

The '=' symbol is padding. Base64 converts data in blocks of 3 bytes. If the final block has fewer than 3 bytes left, padding characters ('=' or '==') are added so the receiving decoder knows exactly how the bytes align.

Related Tools & Utilities