How to use this base encoding overhead calculator
Enter a source size in bytes or paste text, and the page reports the output length, ratio and growth for base64, base32, base58 and hex at once. You can also choose whether base64 padding is kept. Building an image Data URI belongs to a different tool; this one only compares size.
How it is calculated
Padded base64 is 4 x ceil(n / 3) and unpadded is ceil(4n / 3). base32 is 8 x ceil(n / 5) and hex is 2n. base58 is not block based, so it is estimated with the log(256) / log(58) ratio and is labelled as an estimate in the result. The block sizes come straight from each encoding specification as of October 2026.
Limits and cautions
Memorising a single ratio will mislead you. One byte in base64 is 4x, and any length that is not a multiple of 3 lands above the asymptote. The MIME variant that wraps lines adds a separator every 76 characters, so it runs slightly larger than this figure. Compression and transport headers are not included.
Frequently asked questions
Only asymptotically. Small inputs cost far more: one byte becomes four characters with padding, which is 4x, and two bytes also become four characters, which is 2x. The ratio is exactly 4/3 only when the length is a multiple of 3, so use 4 x ceil(n / 3).
Padding is at most two characters, so the saving is at most two characters. One byte drops from four characters to two, two bytes from four to three, and long inputs barely change. Unpadded base64url exists to fit URLs and file names, not to save space.
base58 does not cut the input into fixed blocks. It treats the whole input as one large integer and rewrites it in base 58, so two inputs of the same length can differ by one character, and leading zero bytes each add a character. This page estimates with log(256) / log(58).