What Is Base64: Why It Grows About 33% and Isn't Encryption
Base64 rewrites bytes using 64 characters. Why 3 bytes become 4 characters, what the trailing = means, base64url, data URIs, and why it is not encryption.
📚 Free Web Tools · 20/52·⏱ About 4min read·Information updated 2026-11-03
📋 Key facts5
Standard
RFC 4648 (October 2006)
Alphabet
A–Z, a–z, 0–9, + and / (64 characters) plus the pad character =
Size
3 bytes → 4 characters, about 4/3 (roughly 33% larger)
URL-safe
base64url uses - instead of + and _ instead of /
Security
Anyone can reverse it; it is encoding, not encryption
What Base64 is
Base64 is an encoding that rewrites photos, files or any bytes using only 64 characters: upper- and lowercase Latin letters, digits, + and /. The standard is RFC 4648 (October 2006). It is used when binary data has to travel through places designed for text, such as email, JSON or HTML. Because the result is plain text, it can be copied and pasted, and there is less risk of unusual bytes being mangled along the way.
Why it grows by about 33%
Base64 cuts the input into 3-byte (24-bit) blocks, splits each into four 6-bit pieces and maps each piece (0–63) to one character. Three bytes become four characters, so the result is about 4/3 the size of the original, roughly 33% larger. For example, the three letters Man (3 bytes) become the four characters TWFu. Formats that insert a line break every 76 characters, as email does, grow a little more because of the line breaks. This site's Base64 tool shows the input and output size in bytes and the percentage change.
3 bytes → 4 characters
Man → TWFu
A 1 MB file → about 1.33 MB of text
What the trailing = means
If the input length is not a multiple of three, the last block is short. One or two = characters are then added so the output length is a multiple of four; these are called padding. If the last block has 1 byte, == is added; if it has 2 bytes, = is added. Some formats leave the = out, so if decoding fails, try adding = until the length is a multiple of four.
Hangul is converted to UTF-8 first
Base64 works on bytes, not characters. Korean text is first turned into UTF-8 bytes and then encoded; since one Hangul syllable is 3 bytes, the two-syllable word 한글 (6 bytes) becomes the eight characters 7ZWc6riA. If Base64 made from another character set (such as EUC-KR) is decoded as UTF-8, the text comes out garbled, so you need to match the character set the sender used. This site's tool converts text as UTF-8.
base64url for addresses
The + and / of standard Base64 have special meanings in URLs and cause problems there. RFC 4648 therefore also defines base64url, which replaces + with - and / with _. JWT, a common login token format, uses this variant and drops the =. Putting a base64url string into an ordinary Base64 decoder may fail because of the - and _ characters; replace them with + and /, add padding, and then decode.
Embedding images with data URIs
On a web page you can place an image directly in HTML or CSS, without a separate file, by putting a Base64 string after data:image/png;base64,. For small icons this can reduce the number of requests, but the data is about 33% larger and is not cached separately from the page, so it does not suit large images.
It is not encryption
Base64 is an encoding that anyone can reverse without a key. Turning a password or personal data into Base64 does not hide it. HTTP basic authentication, for example, sends the user name and password in Base64, so without an encrypted connection (HTTPS) they are exposed as they are. Data that must stay secret needs real encryption.
Summary
Base64 is only packaging that turns bytes into text; it is neither compression nor encryption.
3 bytes become 4 characters, about 33% larger
The trailing = is padding to fix the length
Hangul is turned into UTF-8 bytes before encoding
For URLs, base64url uses - and _
Anyone can reverse it, so it does not protect secrets