Base64 Size Overhead Calculator

Base64 encoding lets binary data pass through text-only channels, but it makes the data about a third larger. The exact encoded size depends on the raw byte count, because Base64 packs every 3 input bytes into 4 output characters and pads the final group. Enter the raw size in bytes and, optionally, a line length if your variant wraps lines. This calculator returns the encoded size, the number of padding characters, the byte overhead, and the percentage growth.

0.00
0.00
0.00
0.00

Base64 size formula

groups = ceil(bytes / 3)
base encoded = groups * 4
padding = (3 - (bytes mod 3)) mod 3
line breaks = line length > 0 ? floor((base encoded - 1) / line length) : 0
encoded size = base encoded + line breaks

Each line break is counted as one byte. With no line wrapping the encoded size is exactly 4 times the number of 3-byte groups.

Encoded size examples (no line breaks)

  • 1 byte: 4 bytes encoded (300 percent growth from a tiny input).
  • 3 bytes: 4 bytes encoded (33.3 percent growth).
  • 1,000 bytes: 1,336 bytes encoded.
  • 1,000,000 bytes: 1,333,336 bytes encoded.
  • The growth approaches 33.33 percent as the input gets larger.

Base64 overhead: frequently asked questions

How much larger is Base64 than the original?

Base64 encodes every 3 bytes of input as 4 output characters, so the encoded data is about one third (33.3 percent) larger than the raw data, before counting any line breaks. With padding the exact encoded length is 4 times the number of 3-byte groups, rounding the input up to a multiple of 3.

What is the exact Base64 length formula?

The encoded length in characters is 4 times the ceiling of the input bytes divided by 3. For 10 input bytes, ceiling of 10/3 is 4 groups, so the output is 16 characters including padding. The padding characters (=) fill the final group to 4 characters.

Does Base64 add line breaks?

Some variants (such as MIME) insert a line break every 76 characters, which adds a small extra overhead. This calculator gives the core encoded size first, then optionally adds line-break bytes if you set a line length. The plain RFC 4648 encoding has no line breaks.

Why use Base64 if it grows the data?

Base64 lets binary data travel safely through text-only channels such as email bodies, JSON, URLs, and HTML data URIs, where raw bytes could be corrupted. The roughly 33 percent size cost is the price of that safety, which is why Base64 is avoided for large payloads where a binary channel is available.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 19 June 2026. See our methodology.