Base64 Size Calculator

Calculate the encoded size of Base64 data, data-URI overhead, and decoded bytes

Frequently Asked Questions

How much larger is base64 than the original data?

Base64 encodes every 3 bytes into 4 ASCII characters, so the encoded size is ceil(bytes ÷ 3) × 4. That is a ~33% size increase before any line breaks - 900 bytes becomes 1,200 characters.

Why is the formula ceil(bytes/3)×4 instead of just bytes×4/3?

Base64 works in 3-byte groups, and any leftover 1 or 2 bytes still produce a full 4-character block padded with "=". The ceiling on bytes ÷ 3 accounts for that partial final group, so 1 byte still encodes to 4 characters.

What overhead does a data URI add?

A data URI prepends a header like "data:image/png;base64," (about 22 characters plus the MIME type) to the encoded payload. So total length ≈ header length + ceil(bytes ÷ 3) × 4.

When is base64 worth the size penalty?

Inlining tiny assets as data URIs saves an HTTP round-trip, which can beat the ~33% size cost for small icons under a few KB. For large files the inflation and loss of caching usually outweigh the saved request.

Important Disclaimer: Estimates for informational purposes only.

This calculator provides estimates for informational purposes only. Results are based on assumptions and may not reflect actual outcomes. Consult qualified professionals in relevant fields before making important decisions based on these results.