Base64 Size Calculator
Enter the size of your data and choose whether lines are wrapped. The calculator gives the Base64 length, how much bigger it is, the padding characters, the line break overhead and the size as a data URL.
- Base64 length
- Overhead
- Padding
Email attachments use MIME wrapping at 76 characters. Data URLs and JSON usually use no wrapping.
Base64 turns every 3 bytes into 4 characters. So encoded data is about 33% bigger. A 1 MB image becomes about 1.33 MB of text, and email's 76-character line wrapping adds about 2.6% more. Padding with = signs makes the length a multiple of 4.
Base64 size chart
No line wrapping. Search for a size.
| Original | Base64 | Padding |
|---|---|---|
| 1 byte | 4 | 2 |
| 2 bytes | 4 | 1 |
| 3 bytes | 4 | 0 |
| 10 bytes | 16 | 2 |
| 100 bytes | 136 | 2 |
| 1,000 bytes | 1336 | 2 |
| 1,000,000 bytes | 1333336 | 2 |
4 × ⌈n ÷ 3⌉.
Bytes and characters
No wrapping. Slide the bytes.
Each group of 3 bytes becomes 4 characters. Yellow squares are padding.
How to work out Base64 size
Bytes to characters. Step through it.
Bytes
Input size.
To find the original size from Base64, multiply its length by 3, divide by 4 and take off the padding.
Base64, hex or raw binary
Encodings. Compare them.
No encoding.
Text safe.
Readable.
Base64url swaps + and / for - and _ so the text is safe in web addresses.
Before encoding
Encoding checks. Tick each item.
Tick each item as you go.
Embedding big images as Base64 in pages slows loading. Link to files instead where you can.
What you get
Base64 sizing. Each tile explains one result.
Characters.
Per cent.
Equals signs.
Bytes.
Bytes.
Email size limits apply to the encoded size, so a 20 MB attachment can break a 25 MB limit.
Frequently Asked Questions
No question matches that search.
How much bigger is Base64?
About thirty-three per cent, as every three bytes become four characters.
How do I calculate Base64 length?
Divide the bytes by three, round up and multiply by four.
What are the equals signs at the end?
Padding, added when the data is not a multiple of three bytes.
Why do email attachments grow?
They are sent as Base64 with line breaks, adding about thirty-seven per cent.
How do I get the original size back?
Multiply the Base64 length by three, divide by four and subtract the padding.
Is Base64 encryption?
No. Anyone can decode it. It only makes binary data safe as text.
What is Base64url?
A version with web-safe characters, often without padding.
Know the encoded size
Work out Base64 size before you embed or send, and stay inside size limits.
More size calculators
Each one has its own calculator, worked examples and answers to common questions.