No ads, no sign-upChecked 2026-08-23

Base64 Size Calculator

Result

1,336B

Result: 1,336 B

Base64 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.

The numbers at a glance

File size (B)Result (B)
00
250336
500668
7501,000
1,000Your value1,336
1,2501,668
1,5002,000
1,7502,336
2,0002,668

Worked examples

How it's calculated

encoded = ceil(bytes ÷ 3) × 4

  1. StepEnter the raw size of the file in bytes.
  2. StepDivide by 3 and round up — that is the number of 4-character groups.
  3. ResultMultiply by 4 to get the encoded size, padding included.

What this number means

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.

About a third larger, whatever the size

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.

The prefix and line breaks are not counted

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.

The length is always a multiple of four

A partial final group is rounded up to four characters with = filling the unused positions. A short tail therefore never makes the output smaller.

Commonly misread

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.

Reference table

Input (B)GrowthBase64 (B)
1+300 %4
2+100 %4
3+33 %4
100+36 %136
1000+34 %1336
1048576+33 %1398104

Questions

How much does Base64 add to a file?

One third, plus padding to the next multiple of 4. A megabyte of data becomes roughly 1.37 MB of text.

Why do 1, 2 and 3 bytes all encode to 4 characters?

Base64 always emits a full group of four. Short groups are filled with one or two “=” characters, which still occupy a byte each.

Do line breaks count?

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.

Is the result in bytes or characters?

Both — the Base64 alphabet is plain ASCII, so one character is one byte. Sizes here are decimal, so 1 kB means 1,000 bytes.

Sources and last check

  1. en.wikipedia.org

Information, not professional advice.