Amusement

My Scattered Bits

FaceBookFlickriStockLast.FMTwitterTwitter - my iTunesVideo.caYouTube

Helping WTL Help You

Companies

Currently Listening

Recently Twittered

RSS Feeds

The 35% Email Tax

1:32AM, February 21, 2007 - [ Permalink]

When you send an email with an attachment, you may (or more likely not) notice that the outgoing email is larger than the file you attached. Perhaps you have wondered why.

This is because most files are not actually plain old text. They are binary files, like photos, PDFs, movies, documents etc.

Email wasn't originally designed to handle anything other than text - attaching files, from my understanding, is a hack.

Most "regular" email is sent as ASCII text, using the 95 printable characters. Each character represents a byte of information. A byte can hold a value of 0 to 255, and in binary files, it does.

Herein lies the problem - how do you represent a value of 193 when your range is 1 to 95? The answer is to split the values up across multiple bytes.

Enter Base64 encoding, which does this nasty work for you (rather than having to pull out paper and pencils).

I was curious to see if any file types were handled differently or not (they shouldn't be), so I ran some tests by sending files to myself, opening the emails in bbEdit, stripping out everything that wasn't the attachment from the email and resaving the text file, then compared the file byte sizes.

Email Attachment conversions:


.JPG (Joint Photographic Experts Group compression method for photographic images)
103,237 bytes becomes 139,815 bytes +35.43%
5,276,847 bytes becomes 7,128,726 bytes +35.09%

.PNG (Portable Network Graphics)
5,245,286 bytes becomes 7,086,091 bytes +35.09%

.PDF (Portable Document Format)
4,860,859 bytes becomes 6,566,756 bytes +35.09%

.MOV (QuickTime file)
5,227,246 bytes becomes 7,061,751 bytes +35.09%

.DOC(Microsoft Word file)
1,482,752 bytes becomes 2,003,393 bytes +35.11%

As you can see, they all average an increase in size of 35% - what I call the email tax.

If you are trying to send a file to someone with a mailbox with a known maximum email size, here are some guidelines for the maximum size of the attachment. I have subtracted 4 kb (4,096 bytes) from the final size to allow for email headers and the actual text of the email.


Maximum email sizeMaximum Attachment size
1 Mb (1,048,576 bytes)754 Kb (772,627 bytes)
2 Mb (2,097,152 bytes) 1.47 Mb (1,549,350 bytes)
5 Mb (5,242,880 bytes) 3.69 Mb (3,879,519 bytes)
10 Mb (10,485,760 bytes) 7.40 Mb (7,763,134 bytes)
20 Mb (20,971,520 bytes) 14.81 Mb (15,530,363 bytes)
50 Mb (52,428,800 bytes) 37.03 Mb (38,832,052 bytes)

I hope you find this useful. If you have any questions or comments, there is an email link in the navigation menu on the left.

These icons link to social bookmarking sites where readers can share and discover new web pages.