What is an MBOX file? Format, uses and how to view one

A plain explanation of the MBOX format: how messages are stored, where the files come from and what you need to read them.

Desktop monitor showing the raw text structure of an MBOX file with From lines highlighted

An MBOX file is a mailbox saved as a single text file. Instead of keeping each email separately, it places every message one after another, so a whole folder such as Inbox or Sent becomes one file. The name simply means “mailbox”.

The format began on Unix systems in the 1970s and has never really gone away. Today it is mostly used for exports and backups, because almost every mail program can read it.

How messages are stored inside an MBOX file for MBox Viewer

Open an MBOX file in a text editor and you will see ordinary email source code. Each message begins with a separator line that starts with the five characters From (the word “From” followed by a space). That line normally carries the sender address and a date.

After the separator come the usual email headers: From:, To:, Subject:, Date: and many technical ones. A blank line follows, then the message body. The next separator line marks where the following email starts.

Since a body line could also begin with “From ”, programs add a > in front of such lines when they write the file. A good viewer removes that character again when it shows the message.

Where attachments go in files MBox Viewer opens

MBOX has no separate storage for files. Attachments live inside the message itself using MIME, the same standard every email uses on the internet. A PDF or photo is converted to Base64 text and placed between boundary lines.

This is why MBOX files are often larger than you expect. Base64 adds about a third to the size of every attachment.

Slightly different MBOX versions MBox Viewer handles

There is no single official specification, so a few variants exist:

  • mboxo and mboxrd differ in how they escape body lines that start with “From ”.
  • mboxcl and mboxcl2 add a Content-Length header so programs can skip ahead without scanning.

In everyday use the differences rarely matter. RFC 4155 describes the common layout and registers the media type application/mbox.

Programs that create MBOX files for MBox Viewer

  • Google Takeout exports Gmail as one large .mbox file.
  • Thunderbird stores local folders as MBOX files without an extension.
  • Apple Mail creates a .mbox package when you export a mailbox.
  • Unix and Linux mail systems keep spool files in MBOX format.
  • Many backup and migration tools offer MBOX as an output option.

Strengths and weaknesses of MBOX and MBox Viewer

The main strength is portability. Because it is plain text, an MBOX file can still be read decades later, on any system, without the program that made it.

The weaknesses come from the same design. One damaged section can confuse programs that read the rest of the file. Finding a single message means scanning the whole file. And very large files take a lot of memory to load at once.

Formats such as Maildir solve some of this by saving each message as its own file. MBOX remains popular for exports because a single file is easier to download and move.

How to open an MBOX file with MBox Viewer

You have three realistic options:

  1. Use a viewer. A dedicated MBOX viewer reads the file directly and shows a normal message list. Nothing is imported or changed.
  2. Import it into a mail client. Thunderbird (with the ImportExportTools NG add-on) or Apple Mail can bring the messages into a local folder.
  3. Read it as text. A text editor works for a quick look at small files, but attachments and encoded text will not be readable.

Tip: if a file has no extension and you are unsure what it is, open it in a text editor and look at the first line. If it begins with “From ” followed by an address and a date, it is almost certainly MBOX.

On Windows, the quickest route is MBox Viewer, the free program in the download section of this site: unzip it, run mboxview64.exe and select the folder that holds your MBOX file. On a Mac, Apple Mail or Thunderbird can import the file instead.

Related MBox Viewer articles