Binary data must often be turned into text, and the text is bigger. The data encoding overhead calculator gives the exact size of your data after Base64, Base64 MIME, Base32, hexadecimal, Base85 or percent-encoding, with the overhead and the extra transfer time.
How the calculation works
- Enter the size of the original data in bytes and choose the encoding: Base64, Base64 MIME, Base32, hexadecimal, Base85 or percent-encoding.
- Enter the speed of the connection in Mbps to estimate the extra time of the transfer.
- The calculator uses the exact rule of each encoding: for example, Base64 turns each group of 3 bytes into 4 characters, with padding, so the size is 4 × ceil(n / 3).
- The result is the size of the encoded data, the overhead in percent, the extra bytes and the extra time.
Example
A file of 1,000,000 bytes encoded in Base64 becomes 4 × ceil(1,000,000 / 3) = 1,333,336 bytes, which is 1.272 MiB. The overhead is 33.34 %, or 333,336 extra bytes. On a 100 Mbps link, the extra data takes 0.0267 s to send. With hexadecimal encoding, the size would double.
Why it matters
The calculator helps developers, system administrators and anyone who sends files in JSON, e-mail or a data URI to estimate the size of a payload, the cost of bandwidth and storage, and the limits of an API that accepts a given number of characters.
Good to know
The sizes are computed from the rules of the encodings, with the padding of the standard. Some libraries omit the padding or add line breaks differently, so the real size can differ by a few bytes. The transfer time is only the time for the extra bytes at the speed you enter, and it ignores the protocol overhead and the compression. The percent-encoding value is the worst case: ordinary text is much smaller.
Related tools
The Ethernet overhead calculator covers the overhead of the frames, the download time calculator turns a size and a speed into a duration, the hash collision calculator covers hashes, and the cloud storage cost calculator prices the storage of the data.