- File size
- 1000B
1,336B
Open with these values1,336B
Result: 1,336 BBase64 turns every 3 bytes into 4 characters and pads the last group with “=”, so the output is always a multiple of 4: encoded = ceil(bytes ÷ 3) × 4. That is about 33 % larger — 1,000 bytes become 1,336, and even 1 byte becomes 4.
| File size (B) | Result (B) |
|---|---|
| 0 | 0 |
| 250 | 336 |
| 500 | 668 |
| 750 | 1,000 |
| 1,000Your value | 1,336 |
| 1,250 | 1,668 |
| 1,500 | 2,000 |
| 1,750 | 2,336 |
| 2,000 | 2,668 |
1,336B
Open with these values4B
Open with these values1,398,104B
Open with these valuesencoded = ceil(bytes ÷ 3) × 4
Base64 represents arbitrary binary data using only printable ASCII characters, which is why it turns up in data URIs, MIME email attachments, JSON Web Tokens and embedded images. It works by splitting the input into groups of three bytes — 24 bits — and re-encoding each group as four characters of six bits. That is the whole story behind the size: encoding n input bytes produces ceil(n / 3) × 4 output bytes. The ceiling is the padding. A partial final group is still rounded up to a full four characters, with = filling the unused positions, so the encoded length is always a multiple of four and a short tail never makes it smaller. For a 1000-byte file that means 1000 ÷ 3 = 333.33, rounded up to 334 groups, times four is 1336 bytes. Because four characters always carry three bytes, the result sits close to four thirds of the original — an overhead of about 33 percent, whatever the size. That predictability is the trade: text-only protocols get to carry binary data, and the price is a third more space. The caveat that matters most is what this figure leaves out. It counts raw Base64 output only: no data-URI prefix such as data:image/png;base64, and no line breaks, though classic MIME wraps every 76 characters. Add those bytes yourself.
Four characters always carry three bytes, so the encoded form sits near four thirds of the original. The overhead is roughly 33 percent at any file size.
This figure is raw Base64 only — no data-URI prefix, and no line breaks, though classic MIME wraps every 76 characters. Add those bytes yourself.
A partial final group is rounded up to four characters with = filling the unused positions. A short tail therefore never makes the output smaller.
Base64 compresses the data.
It is an encoding, not a compression. It makes binary safe for text-only channels and costs a third more space to do it.
The encoded size grows smoothly with the input.
It steps in blocks of four characters, because input is consumed three bytes at a time. One extra input byte can add four output bytes.
| Input (B) | Growth | Base64 (B) |
|---|---|---|
| 1 | +300 % | 4 |
| 2 | +100 % | 4 |
| 3 | +33 % | 4 |
| 100 | +36 % | 136 |
| 1000 | +34 % | 1336 |
| 1048576 | +33 % | 1398104 |
One third, plus padding to the next multiple of 4. A megabyte of data becomes roughly 1.37 MB of text.
Base64 always emits a full group of four. Short groups are filled with one or two “=” characters, which still occupy a byte each.
This calculator gives the unwrapped length. MIME wraps at 76 characters and adds two bytes per line, which is another 2 to 3 % on top.
Both — the Base64 alphabet is plain ASCII, so one character is one byte. Sizes here are decimal, so 1 kB means 1,000 bytes.
Information, not professional advice.
Diese Seite gibt es auch auf Deutsch.
Zu Deutsch wechseln