Base64 Size Calculator

Work out exactly how much bigger your data gets after Base64 encoding — and the original size behind any Base64 string. The rule of thumb is +33%; this gives you the precise number.

Original size → Base64 size

Base64 string → original size

How much larger is Base64?

Base64 encodes every 3 bytes (24 bits) of input as 4 ASCII characters (each carrying 6 bits). Four characters for three bytes is a ratio of 4/3 — so encoded data is about 33.3% larger than the original. Because each Base64 character is one byte on the wire, "length in characters" and "size in bytes" are the same number for the encoded text.

The formula

For an input of n bytes, the padded Base64 length is:

base64_length = 4 × ceil(n / 3)

Going the other way, after stripping = padding, the original size of a Base64 string is:

original_bytes = floor(base64_length_without_padding × 3 / 4)

Worked example

A 100-byte file encodes to 4 × ceil(100 / 3) = 4 × 34 = 136 characters — an overhead of 36% (small inputs round up more). A 1 MB file encodes to about 1.33 MB, settling at the ~33.3% asymptote as size grows.

Tip: if you're hitting a database column or request-size limit, size the field for the encoded length (×4/3), not the original — and remember MIME-wrapped Base64 adds another ~1.4% for newlines.

Frequently asked questions

How much bigger is Base64 than the original?

About 33% — four characters for every three bytes. Padding makes very small inputs slightly worse.

What is the Base64 length formula?

4 × ceil(n / 3) for n bytes (padded, no line breaks).

How do I find the original size from a Base64 string?

Strip = padding, then floor(length × 3 / 4) gives the byte count.

Does line wrapping add size?

MIME Base64 wraps at 76 characters, adding ~1.4%. Standard and URL-safe Base64 have no line breaks.

Encode or decode something?

The main base64.dev tool handles text, images, files, and URL-safe Base64 with auto-detect.

Open base64.dev →