Base64 Size Calculator
Enter a number of input bytes to see exactly how many bytes the Base64-encoded result will take — including the padding that rounds every group up to four characters.
Exact encoded size
Enter the number of input bytes and the calculator returns the Base64 output size as ceil(n / 3) × 4 bytes, padding included.
About a third bigger
Base64 always grows the data by roughly 33% — three input bytes become four output characters, so plan for the overhead before you transmit or store.
What is Base64 encoded size?
Four output bytes for every three input bytes
The Base64 size calculator tells you how large a piece of data becomes once it is Base64-encoded. Base64 is a way of representing arbitrary binary data using only printable ASCII characters, which is why it shows up in data URIs, email attachments (MIME), 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 each. Because the input is grouped in threes, encoding n input bytes produces ceil(n / 3) × 4 output bytes — the final group is padded with "=" so that every group is a full four characters. The practical consequence is a predictable overhead of about one third on top of the original size.
Enter the number of input bytes to get the Base64-encoded size in bytes instantly, with padding already counted.
Base64 packs every three input bytes into four output characters, so the encoded size is the number of three-byte groups (rounded up) multiplied by four.
encoded = ceil(n / 3) × 4The ceiling is what accounts for padding: any partial final group is still rounded up to a full four characters, with "=" filling the unused positions. Because four output characters always represent three input bytes, the encoded size is roughly 4 / 3 of the original — about a 33% increase no matter how large the input.
Suppose you want to Base64-encode a file of 1000 bytes.
Divide by three
1000 / 3 = 333.33 — the number of three-byte groups before rounding.
Round up to whole groups
ceil(333.33) = 334 — the last partial group still counts as a full group.
Multiply by four
334 × 4 = 1336 bytes — the Base64-encoded size, including the padding that fills the final group.
The encoded size (1336 bytes for the 1000-byte file above) is the number of bytes the Base64 text will occupy — useful when you need to budget storage, estimate a payload size, or check whether an embedded image will fit inside a size limit. The key pattern is that Base64 emits four output characters for every three input bytes, which is where the roughly 33% overhead comes from: the result is always close to 4 / 3 of the original. The ceiling and the "=" padding mean the encoded length is always a multiple of four, and a partial final group never makes the output smaller — it rounds up. That predictability is exactly why Base64 is convenient for protocols that only allow text, even though it costs you a third more space than the raw bytes.
The formula is exact, but a couple of practical points are worth keeping in mind.
Encoded bytes only — no wrappers or line breaks
This calculator counts the raw Base64 output bytes from ceil(n / 3) × 4. It does not add the bytes for a data-URI prefix such as "data:image/png;base64,", nor the extra characters from line breaks if the output is wrapped (classic MIME wraps every 76 characters). If your encoder inserts newlines or you embed the result in a larger string, add those bytes on top of the figure shown here.