Base64 encoded-size table with padding
Standard padded Base64 needs 4 × ceiling(original bytes ÷ 3) characters, excluding line breaks. Three input bytes become four encoded characters; very small inputs can have a larger percentage overhead because of padding.
Base64 encoded-size table with padding
| Original bytes | Padded Base64 characters | Extra characters vs input bytes | Size increase |
|---|---|---|---|
| 0 | 0 | 0 | Not applicable |
| 1 | 4 | 3 | 300.00% |
| 2 | 4 | 2 | 100.00% |
| 3 | 4 | 1 | 33.33% |
| 100 | 136 | 36 | 36.00% |
| 1024 | 1368 | 344 | 33.59% |
| 100000 | 133336 | 33336 | 33.34% |
| 1000000 | 1333336 | 333336 | 33.33% |
Formula & method
Encoded characters = 4 × ceil(n ÷ 3)
Increase% = (encoded characters ÷ n − 1) × 100 for positive n.The formula assumes the standard padded Base64 representation, one-byte ASCII encoding, no line wrapping and no enclosing format. A JSON string adds quotes and possibly other structure. A data URL adds its media type and prefix. Percent-encoding the result can increase its size again.
Base64 is an encoding, not encryption or compression. A large binary payload approaches a four-to-three size ratio before any later transport compression. Unpadded Base64url can have a different length, so do not use the padded formula unchanged for that representation.
Worked example
A 1,024-byte binary payload becomes 1,368 Base64 characters: 4 × ceil(1,024 ÷ 3). The increase is 344 characters, approximately 33.59%, before adding a data-URL prefix or JSON wrapper.
What can change the answer
The table is for standard padded Base64 without line breaks. A smaller HTTP transfer after compression does not change the uncompressed encoded character count.
Sources & definitions
Method checked:
Continue with a related task
Data Storage Converter
Convert a decimal GB amount into bytes and decimal or binary storage units. One GB is 1,000,000,000 bytes; one GiB is 1,073,741,824 bytes.
Page View Revenue Calculator
Page views equal visits multiplied by pages per visit. Estimated revenue equals those page views divided by 1,000, multiplied by page RPM.
Cache Origin Savings Calculator
Expected origin requests equal total requests multiplied by one minus the cache-hit fraction. At 80% hits, 100,000 requests leave 20,000 expected origin fetches.
Uptime Downtime Budget Calculator
Allowed downtime equals the monitoring window multiplied by one minus the uptime target. A 99.9% target over 30 days allows 43.2 minutes in this time-based model.