Skip to content
OneKitly

An Attachment Grows by a Third Inside the Email

Published 9/7/2026 · 4 min read · File tools

Daniel Okonkwo

Daniel OkonkwoFront-end developer and tech writer at OneKitly

Web performance · File formats

Checked against 3 sources

View profile
In short

Mail was designed to carry text, so a file has to be rewritten as text before it can travel. The encoding used is base64: every three bytes become four printable characters, and MIME then breaks the result into lines of 76 characters, each ending in a carriage return and a line feed. Three bytes as four is a fixed 1.3333 times, the line breaks add another 2.6 %, and the measured total is 1.3684 — a 10 MiB file occupies 13.684 MiB of the message. Working backwards, a 25 MB sending limit carries about 18.3 MiB of actual files, a 20 MB limit about 14.6 MiB, and a 10 MB limit about 7.3 MiB, before the message body and headers take their share. The extractor here reverses the encoding and gives you the original bytes back, byte for byte: the growth exists only inside the message.

Mail carries files as text, three bytes written as four characters. A 10 MiB attachment occupies 13.68 MiB of the message, which is why a 25 MB limit really means about 18 MiB of files.

Why a file cannot travel as itself

The mail protocols were written when a connection guaranteed seven bits per character and nothing else. A byte from a PDF or a photograph can be any of 256 values, several of which mean something to a mail server — a lone carriage return, a null, a line that happens to start with a full stop. Base64 sidesteps all of it by using only 64 characters that every system agrees about, at the cost of writing four of them for every three bytes. The arithmetic is not an implementation detail you can optimise away: it is the price of the guarantee that the file arrives identical.

It also explains why compressing before attaching helps and re-compressing an already compressed file does not. A folder of documents zipped down to a third of its size costs a third of the base64 too, because the encoding is applied to whatever bytes you hand it. A photograph or a PDF is already compressed, so zipping it saves nothing and the 1.3684 still applies to the full size.

Getting the files out, and the names right

Each attachment sits in its own part of the message, with a Content-Type saying what it is and a Content-Disposition giving the filename the sender chose. Both can be RFC 2047 encoded, so a French invoice can be named =?UTF-8?B?ZmFjdHVyZSBqYW52aWVyLnBkZg==?= in the raw file and Facture janvier.pdf once decoded — the extractor decodes it, which is the difference between a folder of readable names and a folder of gibberish. Filenames also survive spaces and accents intact, both of which some older extraction scripts mangle.

Files that fit
What a sending limit really carries
Stated limitFiles that fitEncoded size
25 MB18.3 MiB25 MB
20 MB14.6 MiB20 MB
10 MB7.3 MiB10 MB
One 10 MiB file10 MiB13.68 MiB (×1.3684)
Extract email attachmentsPull every attachment out of a saved .eml message and download them separately.Try the tool

Frequently asked questions

Is the extracted file identical to the one that was sent?
Yes. Base64 is a lossless encoding, so decoding gives back exactly the bytes that went in — the checksum of the extracted file matches the original. That is why mail can carry a signed PDF or a piece of software without corrupting it, and why the size you see on disk after extraction is the real size rather than the encoded one.
Why is my mailbox bigger than the files I remember receiving?
Partly this, and it adds up. Every attachment you ever received is stored encoded, so a mailbox holding 3 GiB of files takes about 4.1 GiB. On top of that, a message you sent with an attachment is usually kept twice — once in Sent and once in the thread — and a forwarded message carries its attachments again. Extracting and deleting the largest attachments is generally worth more than deleting hundreds of small messages.
Can I get an attachment out of a message that will not open?
Often, yes, and that is one of the better reasons to have this tool. A message whose HTML defeats a mail client is still a well-formed MIME file, and the attachment sits in its own part with its own encoding; the extractor reads the structure rather than rendering the message, so a body that will not display does not stop the file coming out.

Articles you may find interesting

All guides
ExplainerAn .mbox Is Messages Glued End to End, and the Glue Is a LineOne file, thousands of messages, separated by a line beginning From. The format has one famous weakness, and it is the reason a message can lose its ending without anything reporting an error.How-toOpening an .eml File Without Telling the SenderA saved message is a text file you can read anywhere. The catch is that opening it in something that loads remote images announces the moment you did — which is what a tracking pixel is for.ExplainerA Recurring Event Is One Line in the CSV, Not TwelveAn .ics file stores a weekly meeting once, with a rule attached. Export it to CSV and you get a single row for the whole series — which is the file being honest, not the converter losing rows.ExplainerThe Same .ics File Can Mean Five Different TimesiCalendar writes a start time in one of three ways, and only one of them is unambiguous. A meeting written with a named zone, converted on machines in Paris, New York and Honolulu, spanned nineteen hours and changed day.ExplainerConverting Formulas to Values Keeps the Cached Answer, Not the CalculationA spreadsheet file stores both the formula and the last answer Excel computed. Stripping the formula leaves the stored answer — and leaves a blank wherever the file never carried one.ExplainerThe Number 1 and the Text "1" Are Not DuplicatesDeduplication compares whole rows exactly, cell type included. Five identical-looking rows came out as three, because one held a number, one a string and one a string with a leading space.

Related tools

Sources

Spotted a mistake in this article?