Base64 Size Calculator
Base64-encoded data is typically ~33% larger than the original file. Calculate the exact output size before encoding, or estimate the original file size from a Base64 string.
File → Base64
How large will the Base64 output be?
Original
100.00 KB
Base64
133.34 KB
Overhead
+33.3%
Size overhead: +33.34 KB (Base64 encoding overhead)
Base64 → File
How large is the original file?
Paste a Base64 string above
Why Base64 Adds ~33% to File Size
Base64 encodes binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). Every 3 input bytes map to 4 output characters — that 4/3 ratio is the source of the size increase.
If the input length is not a multiple of 3, one or two = padding characters are appended to complete the final 4-character group. At most 2 extra bytes are added.
This size overhead is an inherent property of Base64 encoding and cannot be eliminated without switching to a different encoding scheme.
Base64 Size Formula
encoded_bytes = ⌈n / 3⌉ × 4
Where:
n = original file size in bytes
⌈ ⌉ = ceiling (round up)
Example — 100 KB (102,400 bytes):
⌈102400 / 3⌉ × 4
= 34134 × 4
= 136,536 bytes (~133.3 KB)
overhead: +34,136 bytes (+33.6%)Depending on whether the input length is a multiple of 3, the overhead is always between 33.3% and 33.6%.
Base64 Size Reference Table
Estimated Base64 sizes for common file sizes, excluding padding adjustment.
| Original size | Base64 output size | Size increase |
|---|---|---|
| 1 KB | ~1.33 KB | +344 B |
| 10 KB | ~13.3 KB | +3.4 KB |
| 50 KB | ~66.7 KB | +16.8 KB |
| 100 KB | ~133 KB | +33.6 KB |
| 500 KB | ~667 KB | +167 KB |
| 1 MB | ~1.33 MB | +336 KB |
| 5 MB | ~6.67 MB | +1.67 MB |
| 10 MB | ~13.3 MB | +3.3 MB |
| 25 MB | ~33.3 MB | +8.3 MB |
Frequently Asked Questions
Why is Base64 about 33% larger than the original file?
Base64 encodes every 3 bytes of binary data into 4 ASCII characters — a 4:3 ratio — so the output is always about 33.3% larger. Padding characters (=) add 0 to 2 extra bytes depending on whether the input is a multiple of 3.
What is the exact formula for Base64 output size?
Base64 size (bytes) = ⌈n / 3⌉ × 4, where n is the original file size in bytes and ⌈ ⌉ means ceiling (round up). For example, 100 KB (102,400 bytes) → ⌈102400 / 3⌉ × 4 = 34134 × 4 = 136,536 bytes ≈ 133.3 KB.
Does file compression affect Base64 size?
Yes. Files like JPEG, PNG, MP3, and ZIP are already compressed, so their binary size is smaller and Base64 only adds a fixed ~33%. Plain text files and uncompressed bitmaps have larger binary sizes, resulting in larger Base64 output as well.
Is a Data URL always 33% larger than the original file?
The Base64 data portion is ~33% larger. A Data URL also includes a short MIME prefix (e.g. data:image/png;base64,), but that is only a few dozen bytes and is negligible for files larger than 1 KB.
Should I worry about Base64 size overhead in production?
For small assets (icons, small images, fonts under 10 KB), the 33% overhead is acceptable — especially because it saves an HTTP request. For large files (images over 100 KB, video, large PDFs), the size overhead and inability to cache independently make URL-based files more efficient.
Why is the Base64 → File estimate not exact?
The estimate assumes no padding characters. If you paste an actual Base64 string, the tool reads the padding (= characters) and gives an exact result. When entering a character count manually, padding cannot be known, so the result may be off by 0 to 2 bytes.