Clarks Size Calculator

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
Your data

From 0 to 1000000

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.

Encoded sizes
OriginalBase64Padding
1 byte42
2 bytes41
3 bytes40
10 bytes162
100 bytes1362
1,000 bytes13362
1,000,000 bytes13333362

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.

Size1 ×
Text safeNo
UseFiles, downloads

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.

Length

Characters.

Growth

Per cent.

Padding

Equals signs.

Line breaks

Bytes.

Decoded

Bytes.

Email size limits apply to the encoded size, so a 20 MB attachment can break a 25 MB limit.

Frequently Asked Questions

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.

See all size calculators