Save email as PDF
Home › Email file formats › What is an MBOX file?

What is an MBOX file?

An MBOX file is a mailbox export: a single text file holding many email messages back to back, the file Google Takeout gives you for Gmail and Thunderbird or Apple Mail produce when you export a folder. This page explains how the file is built, how to open it and how to import it into Gmail, Thunderbird or Outlook. You can also drop it on SaveMail to read its messages and save any of them as PDF in your browser; nothing is uploaded.

MBOX file: definition and where it comes from

An MBOX file (extension .mbox, sometimes no extension at all) is the oldest mailbox format still in daily use. It stores an entire folder of email, from a dozen messages to hundreds of thousands, in one file. Each message is a complete RFC 822 email, so an MBOX is in effect a long chain of EML files glued together.

You usually meet an MBOX in three situations. Google Takeout exports every Gmail label as MBOX. Thunderbird keeps each folder as an MBOX under the hood and exports it the same way. Apple Mail's Mailbox, Export Mailbox command writes an .mbox package. Many web hosts, archive services and Unix mail systems use the format too.

Outlook does not create MBOX files; its mailbox format is PST.

Have the email as a file (EML, MSG, MBOX)? Convert it to PDF in your browser: nothing is uploaded.

How an MBOX file is structured

Open an MBOX in a text editor and you see plain text. Each message starts with a separator line that begins with the five characters From (the word From, a space, then an address and a date) and ends just before the next such line. After the separator come the message's own headers (From, To, Date, Subject, Message-ID), a blank line, and the MIME body with its text parts and Base64-encoded attachments.

Because any body line starting with "From " would look like a new message, writers escape such lines by prefixing a greater-than sign, and readers remove it again. Gmail's Takeout export adds its own headers to each message, such as X-Gmail-Labels, so you can tell which labels a message carried.

There is no index. To find message number 5,000, a program has to read the 4,999 before it. That makes MBOX simple to write and portable, but slow to browse when it is large.

How to get and open an MBOX file

To download an MBOX from Gmail, go to Google Takeout, select only Mail, choose the labels you want, and request the export; Google emails a link to a ZIP that contains the .mbox. Step by step: how to back up Gmail emails.

To open the MBOX without installing a mail client:

  1. Open the MBOX to PDF converter on SaveMail.
  2. Drop the MBOX file on the page. SaveMail lists every message inside it by subject, sender and date.
  3. Click a message to read it with headers, body and attachments.

The file is parsed in your browser tab and never uploaded. MBOX files of a few hundred MB open; listing thousands of messages takes a few seconds. Thunderbird and Apple Mail can also open MBOX; the details are in how to open an MBOX file.

Importing an MBOX into Gmail, Thunderbird or Outlook

Gmail has no "import MBOX" button. The usual route is through a desktop client connected to the Gmail account over IMAP:

  1. Install Thunderbird and add the Gmail account.
  2. Import the MBOX file into Local Folders (Thunderbird's import tool or an import add-on does this).
  3. Drag the imported folder onto the Gmail account; Thunderbird uploads the messages over IMAP and they appear in Gmail as a label.

Thunderbird on its own is the easiest home for an MBOX, and Apple Mail imports one through File, Import Mailboxes. Outlook cannot import MBOX directly: convert it to PST with a desktop converter, or use the IMAP route above into a mailbox Outlook is connected to. Full walkthrough: MBOX to Gmail.

Converting MBOX messages to PDF, and the limits

Once a message is open in SaveMail, press Save as PDF and pick Save as PDF in the browser's print dialog. The result is a text-based PDF with the header block, the body, inline images and the attachment list. The attachments themselves are downloaded separately, one by one or as a ZIP, because a PDF page cannot hold a spreadsheet or another email.

Batch export is one PDF per message: open the next message in the list and repeat Save as PDF. A merged PDF of a whole MBOX is not available today. Encrypted messages inside the mailbox are shown as encrypted, and the converter does not edit messages or split the MBOX into separate files.

MBOX vs EML vs MSG vs PST

FormatScopeStructureTypical sourceIn SaveMail
MBOXA folder or a whole mailboxMessages concatenated with "From " separatorsGoogle Takeout, Thunderbird, Apple MailListed, opened and saved one at a time
EMLOne messageRFC 822 headers plus MIME partsGmail Download message, most clientsOpens
MSGOne messageOLE compound file with property streamsOutlook for WindowsOpens
PSTWhole mailbox with folders, contacts, calendarOutlook databaseOutlook exportNot readable; use Outlook

MBOX is the format to ask for when you want a complete, client-neutral copy of a mailbox; EML or PDF is the format to send when someone needs a single message.

Frequently asked questions

How do I import an MBOX into Gmail?

Add the Gmail account to Thunderbird, import the MBOX into Local Folders, then drag the folder onto the Gmail account. Thunderbird copies the messages over IMAP and Gmail shows them under a label.

How do I download an MBOX file from Gmail?

Use Google Takeout: select Mail, pick the labels, and download the ZIP Google sends. The .mbox file is inside.

Can I add an MBOX to Outlook?

Not directly; Outlook reads PST, not MBOX. Import the MBOX into Thunderbird and move the messages over IMAP into the account Outlook uses, or convert MBOX to PST with a desktop converter.

Can I open an MBOX file on Android?

SaveMail on a phone is meant for single EML and MSG files. A large MBOX needs the memory of a desktop browser, so copy the file to a computer and open it there.

Is a Gmail MBOX the same as a regular MBOX?

Yes, it is standard MBOX. Google only adds extra headers such as X-Gmail-Labels to each message so labels and threads can be reconstructed.

How big can an MBOX file be?

The format has no limit; Takeout lets you split an export into chunks of 1 to 50 GB. In SaveMail, files of a few hundred MB open, limited by browser memory.