Base64 Size Calculator
Find the Base64-encoded size of data.
Result
How it is calculated
Base64 turns every group of 3 input bytes (24 bits) into 4 output characters of 6 bits each. If the input is not a multiple of 3, the last group is padded with = characters, so the output is always a multiple of 4. The tool applies encoded = ceil(n ÷ 3) × 4, where n is the original size in bytes, and overhead = (encoded − n) ÷ n × 100. A fractional input is rounded to a whole number of bytes, a negative number gives no result, and 0 gives 0 bytes and 0% overhead. The figure counts the padded output with no line breaks. It does not add the extra newline characters that some formats such as MIME insert into long Base64 text, and it does not include a data URI prefix.
Worked example
You want to embed a file of 1000 bytes in a JSON field as Base64. Step 1: 1000 ÷ 3 = 333.33, and rounding up gives 334 groups. Step 2: 334 × 4 = 1,336 bytes encoded. Step 3: overhead = (1336 − 1000) ÷ 1000 × 100 = 33.60%. Of the 1,336 characters, the final group carries 1 data byte plus padding. For a large file the overhead settles near one third, since 4 characters carry 3 bytes.
Common mistakes
- Entering the size in kilobytes or megabytes. The field takes bytes, so a 2 KB file is 2048 bytes (or 2000, depending on how you count a kilobyte).
- Expecting an exact 33% increase on small inputs. Padding dominates: a single byte becomes 4 characters, an overhead of 300%.
- Forgetting that some systems add line breaks (for example every 76 characters) or a
data:image/png;base64,prefix, which make the real text longer than this figure. - Applying the result to the length of the text you typed rather than the size of the binary data before encoding.
About this calculator
This calculator finds the encoded output size when data is converted to Base64, using ceil(n/3)×4 bytes for n input bytes, since Base64 encoding groups every 3 raw bytes (24 bits) into 4 encoded characters (6 bits each, from a 64-character alphabet) — padding with = characters when the input isn't a multiple of 3. This structure explains why Base64 output is always roughly 33% larger than the original binary data.
Web developers embedding images or files as data URIs, API developers estimating payload size when binary data (like file uploads or authentication tokens) must travel through JSON or XML, and backend engineers sizing database columns or message queue limits for encoded content use this.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Check upload limits against the encoded size, not the file size. A file of 1000000 bytes becomes 1,333,336 bytes, an overhead of 33.33 percent, so an API that caps the request body may reject a file you thought was under the limit. The tool always counts the padding characters, so 3 bytes give 4 and a single byte also gives 4, which is 300.00 percent. What size limit are you trying to stay under?