Base64 quick reference table
Keep this page open while you work with Base64 and you will rarely need to calculate. It collects the numbers that matter in one place: the output length for any input size, the padding rule, the alphabet, and the example encodings people look up most often. Every figure was checked in Python, and you can confirm any of them on the Base64 Encoder Decoder.
Output length table
| Bytes in | Characters out | Padding | Growth |
|---|---|---|---|
| 1 | 4 | == | +300% |
| 2 | 4 | = | +100% |
| 3 | 4 | none | +33% |
| 4 | 8 | == | +100% |
| 5 | 8 | = | +60% |
| 6 | 8 | none | +33% |
| 7 | 12 | == | +71% |
| 10 | 16 | == | +60% |
| 11 | 16 | = | +45% |
| 12 | 16 | none | +33% |
| 100 | 136 | == | +36% |
| 1,000 | 1,336 | == | +33.6% |
| 10,240 | 13,656 | == | +33.4% |
Read the table down the growth column and the pattern is clear: the growth is wild on very short strings — one byte becomes four characters, which is 300% bigger — and settles towards exactly a third as the input grows. A 100-byte message becomes 136 characters, which is 36% bigger, a 1,000-byte message becomes 1,336, which is 33.6% bigger, and a 10-kilobyte file becomes 13,656 characters, which is 33.4% bigger. The formula behind the table is output length = 4 times the ceiling of bytes divided by 3, and the padding column tells you how many equals signs the end needs: two when one byte is left over, one when two are left over, and none when the bytes divide exactly into threes.
The alphabet
The 64 characters, in order, are A to Z for values 0 to 25, a to z for 26 to 51, 0 to 9 for 52 to 61, plus for 62 and slash for 63. The equals sign is not part of the alphabet; it is padding, and it only ever appears at the end. In the URL-safe variant, plus becomes a minus and slash becomes an underscore, and everything else stays the same. If you see a string containing only these characters, with at most two equals signs at the end, it is almost certainly Base64, and you can decode it to find out.
A → QQ== AB → QUI= ABC → QUJD ABCD → QUJDRA== Hello → SGVsbG8= Base64 → QmFzZTY0 Man → TWFu
Example encodings to remember
A few examples cover most of what people look up. A single letter, A, encodes to QQ==, two letters, AB, encode to QUI=, and three letters, ABC, encode to QUJD with no padding at all, which is the cleanest example of the three-bytes-to-four-characters rule. ABCD is four bytes, so it makes two groups and encodes to QUJDRA==, with two equals signs because one byte is left over after the first group. The word Hello encodes to SGVsbG8=, the word Base64 encodes to QmFzZTY0, and Man encodes to TWFu. Notice that only Hello ends with an equals sign: SGVsbG8= carries one, while QmFzZTY0 ends in 0 with no padding, because six bytes divide exactly into two groups of three.
How to use this table
Use the length table when you need to predict a size: a 10-kilobyte file will need about 13,656 characters of space, so a field that holds only 10,000 characters will not fit it. Use the padding column when a decode fails: count the equals signs and check them against the byte count, because a missing equals sign is the commonest cause of a failed decode. Use the alphabet when a string looks wrong: any character outside the 64, or an equals sign in the middle, means the string is not standard Base64, and it may be the URL-safe variant or a different encoding entirely. And use the examples as a test set: if your tool encodes Hello to anything other than SGVsbG8=, the tool is wrong, not the table.
Frequently asked questions
How long is the Base64 of 100 bytes?
136 characters. The formula is 4 times the ceiling of bytes divided by 3, so 100 bytes make 34 groups of 4 characters.
What is A in Base64?
QQ==. One byte gives two real characters and two = signs. AB is QUI= and ABC is QUJD.
What are the 64 Base64 characters?
A to Z (0-25), a to z (26-51), 0 to 9 (52-61), plus (62) and slash (63), with = as padding only.
How much bigger is Base64 output?
About a third on long text: 1,000 bytes become 1,336 characters. Short strings grow more because of padding.
More guides on the Base64 Encoder Decoder
Try the Base64 Encoder Decoder — free, in your browser.