Intermediate

Base64 Encoded Size Calculator

Estimate how large your data becomes after Base64 encoding, accounting for padding, optional line wrapping, and data-URI prefixes.
Original (unencoded) size

Unit

Line wrapping (76 chars)

Adds CRLF every 76 characters

Data-URI prefix

e.g. data:...;base64,
Base64 encoded size
1,398,104bytes

Approx. 1.33 MB

Original size
1 MB
Overhead
33.3%
Added bytes
349,528 B
100%
Encoded payload
Breakdown of total encoded size (~33% overhead from Base64 encoding)
Step by step
  1. 1

    Input size in bytes

    1 × 1,048,576 = 1,048,576
  2. 2

    Base64 encoded length

    4 × ceil(1,048,576 ÷ 3) = 1,398,104
    Every 3 bytes produce 4 Base64 characters; "=" padding rounds up to a multiple of 4.
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Base64 turns every 3 bytes into 4 characters, so encoded size = 4 × ceil(bytes / 3), about 33% larger than the original. Small inputs show extra overhead from "=" padding. Optional MIME line wrapping adds 2 bytes per 76 characters, and a data-URI prefix adds a fixed header of roughly 37 bytes.

Formula
encoded = 4 × ceil(n / 3) bytes; overhead% = (encoded / n − 1) × 100 ≈ 33.3%
How this is calculated

Enter the original (unencoded) data size and pick a unit; the value is converted to raw bytes n = value × unitBytes (1 KB = 1024 B). Base64 encodes every 3 input bytes into 4 output characters, so the encoded length is 4 × ceil(n / 3). The ceil and trailing "=" padding ensure the output length is always a multiple of 4, which is why tiny inputs show more than 33% overhead.

The theoretical overhead is (4/3 − 1) = 33.3%; for large n the overhead% = (encoded / n − 1) × 100 converges to about 33.3%. If line wrapping is enabled, a CRLF (2 bytes) is inserted after every 76 characters, adding 2 × floor(encoded / 76) bytes — the convention used by MIME/PEM. If a data-URI prefix is selected, a fixed prefix such as "data:application/octet-stream;base64," (about 37 bytes) is prepended.

Assumptions: standard Base64 with "=" padding, byte counts (not characters), and binary 1024-based units. The data-URI prefix length varies with the actual MIME type, so treat that component as an estimate. Encoding never reduces size, so the result is always larger than the input.

Frequently asked questions

Base64 rounds output up to a multiple of 4 characters using "=" padding, so very small inputs carry proportionally more padding. As the input grows, the overhead approaches the theoretical ~33.3%.

It adds 2 bytes (CRLF) for every 76 encoded characters, roughly a 2.6% increase on top of the encoded payload. It is required by some formats like MIME and PEM.

The prefix length depends on the MIME type string (e.g. "data:image/png;base64,"). This tool uses a representative ~37-byte prefix, so adjust expectations for shorter or longer MIME types.

Also known as

base64 size calculator
base64 encoded size
base64 overhead
encoding size estimate
data uri size
base64 length
base64 file size
estimate base64 size

APA

TG we-Calculate Editorial Team. (2026). Base64 Encoded Size Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/base64-size-calculator

Chicago

TG we-Calculate Editorial Team. "Base64 Encoded Size Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/base64-size-calculator.

IEEE

TG we-Calculate Editorial Team, "Base64 Encoded Size Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/base64-size-calculator

BibTeX

@misc{wecalculate_base64_size_calculator, title = {Base64 Encoded Size Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/base64-size-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?