
Short answer
Base64 splits data into 6-bit groups and maps each to one of 64 characters, so every 3 bytes become 4 characters and the output is about 33% larger. 'Man' (4D 61 6E) becomes TWFu; 'Ma' becomes TWE= with one = of padding.
1. The idea
Base64 is a way to write binary data using only 64 safe, printable characters: A to Z, a to z, 0 to 9, + and /. It lets bytes travel through systems built for text.
2. Worked example: Man
- 1Take the bytes: M = 4D, a = 61, n = 6E.
- 2Write the 24 bits: 010011 010110 000101 101110.
- 3Look up each 6-bit group (19, 22, 5, 46) in the alphabet: T, W, F, u.
- 4Result: TWFu.
3. Padding
| Input | Bytes | Base64 |
|---|---|---|
| Man | 3 | TWFu |
| Ma | 2 | TWE= |
| M | 1 | TQ== |
When the input is not a multiple of 3 bytes, = characters fill the final group of four.
4. Size
Length = 4 × ceil(bytes ÷ 3). A 22-byte input gives 32 characters (2 of them padding).
5. Not encryption
Anyone can decode Base64. It is only a change of alphabet.
Try it in the Base64 Encode / Decode tool. See also why Base64 decoding fails.
6. Frequently asked questions
What is Base64?expand_more
A binary-to-text encoding that writes data with 64 printable characters. Every 3 bytes become 4 characters.
Why does Base64 end with =?expand_more
Padding. It fills the last group of 4 characters when the input is not a multiple of 3 bytes.
How much bigger is Base64?expand_more
About 33% bigger: 4 characters for every 3 bytes.
Is Base64 secure?expand_more
No. It is an encoding that anyone can reverse, not encryption.