Base64 Encoder/Decoder

By Stuart Mathieson · Updated October 2026

About Base64:

Base64 encoding converts binary data into ASCII text. It's used in emails, URLs, and data URIs. This tool supports UTF-8 for international characters.

How Base64 encoding works

Base64 turns any data into text using 64 characters: A-Z, a-z, 0-9, + and /. It takes the data 3 bytes (24 bits) at a time and splits them into four 6-bit groups. Each group is a number from 0 to 63, which becomes one character. When the data doesn't divide evenly into 3 bytes, = signs pad the end.

Text is first converted to UTF-8 bytes, so accented letters and emoji take more than one byte:

Example Base64 encodings
TextBytesBase64
Hi2SGk=
Hi!3SGkh
Hello5SGVsbG8=
é2w6k=

Every 3 bytes become 4 characters, so Base64 output is about a third larger than the original - 300 bytes become 400 characters.

Things to know

Frequently asked questions

Is Base64 the same as encryption?

No. Base64 is encoding, not encryption - it's fully reversible by anyone and provides no security or confidentiality. Never use it to "protect" sensitive data.

What is Base64 typically used for?

Embedding small images or files as data URIs in HTML/CSS, encoding binary data in JSON or XML, and safely transmitting data through systems designed for plain text.

Why did decoding fail?

The input isn't valid Base64 - it likely contains characters outside the Base64 alphabet or has incorrect padding. Double-check you copied the full encoded string.

Why does Base64 output end with = signs?

Base64 works on groups of 3 bytes. When the data doesn't divide evenly into 3, one or two = signs are added so the output length is always a multiple of 4.

Sources