HomeTech › Base64

Base64 Encoder / Decoder

Output
Input Characters
0
Output Characters
0
Show the math
Enter values to see the worked formula.

What Your Result Means

How This Calculator Works

You paste text and choose Encode or Decode. In encode mode, the tool converts UTF-8 text into bytes, groups them into 6-bit chunks, and maps each chunk to a character in the Base64 alphabet (A–Z, a–z, 0–9, +, /). In decode mode, it reverses the process. Everything runs in your browser — no data is sent to a server.

Quick Questions

Is Base64 the same as encryption?

No. Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string without a key. It is used to safely transmit binary data over text-based channels, not to keep data secret.

Why is my Base64 output longer than the original?

Base64 represents every 3 input bytes as 4 output characters, producing roughly 33% overhead. Padding characters (=) may also be added to bring the output length to a multiple of 4.

Can I encode images or files with this tool?

This tool handles text input only. To Base64-encode a file, you would need to read it as raw bytes first. Many programming languages and CLI tools (like the base64 command on macOS/Linux) support file encoding directly.

What does "Invalid input" mean when decoding?

The input string contains characters outside the Base64 alphabet or has incorrect padding. Valid Base64 uses only A–Z, a–z, 0–9, +, /, and = for padding. Check for accidental spaces or line breaks.

Sources

Method & review

MethodologyHow we calculate this Reviewed & Updated2026-04 Next review2027-04

Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.