What Are MBOX Files and How to Open Them
If you've ever exported your Gmail via Google Takeout, moved away from Thunderbird, or received a mailbox archive from a colleague, you've almost certainly run into an MBOX file. Despite being one of the oldest and most widely used email storage formats, MBOX remains a mystery to most people outside the IT world.
In this guide, we'll cover everything you need to know — from the basics of the MBOX format to practical use cases like email migration, archiving, and forensic investigation.
What is an MBOX File?
An MBOX file is a standard format for storing multiple email messages in a single file. The name stands for "mailbox," which is exactly what it is: a plain-text file that concatenates multiple email messages one after another.
Unlike EML files, which store one email per file, a single MBOX file can contain an entire folder's worth of email — from a handful of messages to millions. This makes MBOX the preferred format for full mailbox exports, long-term archives, and bulk migrations.
Each email in an MBOX file includes:
- Headers: From, To, CC, BCC, Subject, Date, Message-ID, and all technical headers
- Body: Plain text and/or HTML versions of the email content
- Attachments: Any attached files, MIME-encoded within the message
- Inline images: Images embedded in the email body
- Authentication headers: SPF, DKIM, and DMARC results added by receiving servers
MBOX files are governed by RFC 4155, though the format predates that standard by decades — it originated in Unix mail systems in the 1970s and became the de facto standard for storing mail on Unix-like systems.
What Does an MBOX File Look Like Inside?
If you open an MBOX file in a text editor, you'll see something like this:
From john@example.com Mon Apr 14 09:22:14 2025
From: John Smith <john@example.com>
To: Jane Doe <jane@example.com>
Subject: Project Update
Date: Mon, 14 Apr 2025 09:22:14 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Hi Jane, here is the project update for this week...
From sarah@example.com Mon Apr 14 11:05:33 2025
From: Sarah Connor <sarah@example.com>
To: Jane Doe <jane@example.com>
Subject: Re: Project Update
Date: Mon, 14 Apr 2025 11:05:33 -0500
Content-Type: text/plain; charset="UTF-8"
Thanks for the update, Jane. Looking good!
The key thing to notice is the separator line at the top of each message: a line starting with From (with a space after it), followed by the sender address and a timestamp. This is called the mbox separator or From_ line, and it's how parsers know where one message ends and the next begins.
This simplicity is both MBOX's biggest strength and its main weakness. Any email body that happens to start with "From " on its own line needs to be escaped (by prepending a > character), which can cause issues with some parsers.
MBOX vs. Other Email File Formats
MBOX isn't the only format you'll encounter. Here's how it compares to the most common alternatives:
MBOX vs. EML
| Feature | MBOX | EML |
|---|---|---|
| Emails per file | Multiple | One |
| File extension | .mbox | .eml |
| Standard | RFC 4155 | RFC 5322 |
| Best for | Full mailbox exports / archives | Individual emails |
| File size | Can be very large | Typically small |
| Portability | One file for entire mailbox | Individual files per email |
EML files are better when you need to work with individual messages — for example, to attach a specific email to a ticket or share a single message. MBOX is better when you need to move or archive an entire mailbox at once.
If you need to view individual EML files, check out our free EML Viewer tool.
MBOX vs. PST
| Feature | MBOX | PST |
|---|---|---|
| Format | Plain text | Binary (Microsoft proprietary) |
| Created by | Unix/open-source mail systems | Microsoft Outlook |
| Compatibility | Universal (Linux, macOS, Windows) | Primarily Windows/Outlook |
| Contents | Email only | Email, contacts, calendar, tasks |
| Max size | Unlimited | 50 GB (Outlook 2010+) |
| Readability | Can be read in any text editor | Requires specialized software |
PST (Personal Storage Table) files are Microsoft's proprietary mailbox format. Unlike MBOX, PST files can store not just email but also contacts, calendar entries, and tasks. However, they require specialized software to read and are much harder to work with outside the Microsoft ecosystem.
MBOX vs. Maildir
Maildir is another Unix email storage format, but instead of concatenating all messages into one file, it stores each email as a separate file within a directory structure. This avoids the file locking issues that MBOX can suffer when multiple processes try to access the same mailbox simultaneously. Many modern mail servers (Dovecot, Postfix) prefer Maildir for exactly this reason.
MBOX Variants
The MBOX format has several variants that differ in how they handle the separator line and email metadata. The four main variants are:
- mboxo (original): The classic Unix format. "From " lines in the message body are escaped with a leading
>. - mboxrd (Rahul Dhesi): An improvement on mboxo that also escapes ">From " and ">>From " sequences in message bodies to avoid ambiguity.
- mboxcl (Content-Length): Adds a
Content-Length:header to each message, allowing parsers to skip ahead to the next message without scanning for the separator line. - mboxcl2: Like mboxcl but doesn't need to escape "From " lines in the body — it uses the
Content-Lengthheader exclusively for parsing.
For most practical purposes, this distinction doesn't matter — all major email clients handle the common variants transparently. But if you're writing a parser or debugging a malformed MBOX file, knowing which variant you're dealing with can save you hours of frustration.
Common Use Cases for MBOX Files
Email Migration Between Providers
MBOX is the universal transfer format for moving email between different systems. The typical migration workflow:
- Export emails as MBOX from the source system
- Transfer the MBOX file(s) to the destination
- Import the MBOX file into the new email system
This approach works across virtually any combination of providers because virtually every email client and server can read and write MBOX. Whether you're moving from Gmail to Proton Mail, from Thunderbird to Apple Mail, or from a corporate Exchange server to a Google Workspace account, MBOX is the lingua franca.
Google Takeout / Gmail Export
When you export your Gmail data via Google Takeout, your emails are delivered as MBOX files — one file per Gmail label/folder. This is the primary way most people encounter MBOX files.
The export produces files with names like All mail Including Spam and Trash.mbox, Inbox.mbox, or custom label names. These files can be quite large: a Gmail inbox with years of email history can easily produce an MBOX file that's several gigabytes.
If you've downloaded a Google Takeout export and need to inspect the contents, our free MBOX Viewer can open and display the emails without any software installation.
Long-Term Email Archiving
Organizations that need to preserve email for compliance purposes often archive to MBOX. Regulatory frameworks like SOX, GDPR, HIPAA, and SEC Rule 17a-4 often require companies to retain business communications for specific periods — sometimes up to seven years or more.
MBOX is well-suited for compliance archiving because:
- The format is open, plain-text, and will remain readable indefinitely without proprietary software
- Each message preserves its original headers, including SPF, DKIM, and DMARC authentication results
- Files can be stored in standard object storage (S3, Google Cloud Storage) at low cost
- The format is admissible in legal proceedings and widely recognized by eDiscovery tools
Thunderbird Mailbox Format
Mozilla Thunderbird uses MBOX as its native storage format. Each folder in Thunderbird corresponds to an MBOX file (with no extension on the file itself) stored in the Thunderbird profile directory. If you've ever browsed ~/.thunderbird/ on Linux or macOS, you've seen these files.
This means Thunderbird backups are simply MBOX files. You can:
- Back up a specific folder by copying its MBOX file
- Restore it by copying the file back
- Open the backup in any MBOX-compatible viewer or mail client
Email Forensics and Investigation
Security teams and investigators regularly work with MBOX files when conducting forensic analysis of email systems. Common scenarios include:
- Incident response: Export suspicious mailboxes for offline analysis
- Phishing investigation: Trace the origin of phishing campaigns by examining headers across multiple messages
- eDiscovery: Legal proceedings often require bulk email exports in a standard format
- Insider threat investigations: Analyze communication patterns in exported mailboxes
When working with MBOX files forensically, our MBOX Viewer lets you inspect individual messages and their headers without modifying the original file.
Backup and Personal Archives
For individuals, maintaining an MBOX backup of important emails provides peace of mind:
- Export critical email threads as MBOX files and store them in cloud storage
- Keep a local archive of emails from an account you're about to close
- Preserve historical email from a job you're leaving
Because MBOX is a plain-text format, these archives remain readable in any text editor — you'll never be locked out due to discontinued software.
How to Open MBOX Files
Using Our Free Online Viewer
The easiest way to view an MBOX file is with our free MBOX Viewer. Simply drag and drop your file, and it parses the messages and displays them in a clean, readable format — all in your browser, with no upload required.
Key advantages of our MBOX Viewer:
- No upload required: The file is processed entirely in your browser using JavaScript. Your email data never leaves your device.
- Full rendering: See each email with its original HTML formatting, images, and styling
- Message navigation: Browse through all messages in the file with a clear message list
- Header inspection: View all email headers including authentication results and routing information
- Attachment listing: See attachments with their names, sizes, and MIME types
- Large file support: Handles multi-gigabyte MBOX files from Gmail Takeout exports
- Mobile friendly: Works on phones and tablets
- No account needed: No sign-up, no login — just drag, drop, and view
Using Mozilla Thunderbird
Thunderbird is the most capable free desktop application for working with MBOX files:
- Open Thunderbird
- Go to Tools > ImportExportTools NG (you may need to install this add-on first)
- Select Import mbox file
- Choose your MBOX file
Alternatively, you can copy an MBOX file directly into your Thunderbird profile's mail folder, restart Thunderbird, and it will appear as a folder in the sidebar.
Using Apple Mail (macOS)
Apple Mail can import MBOX files through the import wizard:
- Open Apple Mail
- Go to File > Import Mailboxes
- Select Files in mbox format
- Navigate to your MBOX file and click Continue
The emails will be imported into a new "Import" folder in Apple Mail.
Using Gmail (via Google Workspace Migration)
Google doesn't provide a direct MBOX import in the standard Gmail interface, but Google Workspace administrators can use the Google Workspace Migration for Microsoft Exchange (GWMME) tool or third-party migration services that accept MBOX as input.
For personal Gmail accounts, third-party tools like Thunderbird + Google Account (via IMAP sync after local import) provide a workaround.
Using Text Editors
Since MBOX files are plain text, you can open them in any text editor for raw inspection. However, this isn't practical for large files (multi-gigabyte exports will strain most editors). For targeted inspection:
# Count the number of messages in an MBOX file
grep -c "^From " mailbox.mbox
# Extract all subject lines
grep "^Subject:" mailbox.mbox
# Find messages from a specific sender
grep -A 50 "^From: specific@example.com" mailbox.mbox
# Search message content
grep -i "invoice" mailbox.mbox
Using Command-Line Tools
For advanced users, several Unix tools work well with MBOX files:
- mutt: The classic Unix mail client can open and browse MBOX files directly
- formail (procmail package): Splits MBOX files into individual messages
- mb2md: Converts MBOX to Maildir format
- Python's mailbox module: Excellent for scripting MBOX processing
import mailbox
mbox = mailbox.mbox('inbox.mbox')
for message in mbox:
print(f"From: {message['from']}")
print(f"Subject: {message['subject']}")
print(f"Date: {message['date']}")
print("---")
How to Create MBOX Files
From Gmail (Google Takeout)
- Go to Google Takeout
- Deselect all, then select Mail
- Choose your export settings (file format, size limits)
- Click Create export
- Download the resulting
.zipor.tgzfile — it contains MBOX files for each of your Gmail labels
From Thunderbird
- Right-click a folder in Thunderbird's sidebar
- Select ImportExportTools NG > Export folder
- Choose mbox format
- Select a save location
From Apple Mail
- Select one or more mailboxes in Apple Mail's sidebar
- Go to Mailbox > Export Mailbox
- Choose a save location — Apple Mail saves each selected mailbox as an
.mboxpackage (a directory that contains a file calledmboxinside)
Programmatically
Python's built-in mailbox module makes it easy to create MBOX files:
import mailbox
import email.message
# Create a new MBOX file
mbox = mailbox.mbox('archive.mbox')
mbox.lock()
# Add a message
msg = email.message.EmailMessage()
msg['From'] = 'sender@example.com'
msg['To'] = 'recipient@example.com'
msg['Subject'] = 'Test message'
msg.set_content('This is the message body.')
mbox.add(msg)
mbox.flush()
mbox.unlock()
mbox.close()
Security Considerations When Opening MBOX Files
MBOX files from unknown sources deserve the same caution as any email from an untrusted sender — and then some, since a single MBOX file can contain thousands of potentially malicious messages.
Safety Guidelines
- Don't open attachments from MBOX files of unknown origin. Attachments in MBOX messages can contain malware just like email attachments.
- Use our MBOX Viewer for safe viewing — it renders emails in a sandboxed browser environment without executing scripts or loading external tracking pixels.
- Check authentication headers for signs of spoofing. Look at SPF, DKIM, and DMARC results across messages in the file using our DNS Checker and DMARC Analyzer.
- Be aware of email injection attacks: Maliciously crafted MBOX files may attempt to exploit vulnerabilities in parsers through malformed headers or oversized fields.
- Verify the source: If you receive an MBOX file from an unknown party claiming it's your own email export, verify before opening.
Privacy Considerations
MBOX files contain the complete text of every email in the archive, including any sensitive information, personal data, or confidential communications. Treat them accordingly:
- Store MBOX archives with the same care as the emails themselves
- Encrypt MBOX files at rest if they contain sensitive information
- Be cautious about who you share MBOX files with — they contain far more data than a single forwarded email
- Consider whether sharing an MBOX file complies with GDPR or other privacy regulations applicable to your organization
Frequently Asked Questions About MBOX Files
What program opens MBOX files? Mozilla Thunderbird and Apple Mail are the most commonly available desktop apps. For a quick, no-install option, use our free MBOX Viewer — it works entirely in your browser.
Why is my MBOX file so large? MBOX files can be very large because they contain every email in a folder, including all attachments encoded in Base64 (which increases size by about 33%). A Gmail inbox with years of accumulated emails and attachments can easily be several gigabytes.
Can I import an MBOX file into Gmail? Not directly through Gmail's web interface. The most practical approach is to import into Thunderbird first, then use Thunderbird's Gmail integration (via IMAP) to copy messages into Gmail.
Is it safe to open an MBOX file from Google Takeout? Yes — Google Takeout exports are your own email data. However, you should still be cautious about the contents of the emails themselves (phishing messages you received, for example, are still phishing messages in the archive).
Can I convert MBOX to PST? Yes. Tools like Aid4Mail, Mailpile, and various other migration utilities can convert MBOX to PST format for import into Outlook. Some require paid licenses.
How do I split a large MBOX file into smaller files?
The formail tool (part of the procmail package on Linux) can split an MBOX file into individual EML files. In Python, you can iterate through the mailbox.mbox object and write subsets to new MBOX files.
What's the difference between .mbox and .mbx files?
Virtually nothing in practice. Some mail clients (notably older versions of Eudora and Outlook Express) used .mbx as the extension for what is essentially the same format. If you have an .mbx file, try renaming it to .mbox — it will often work.
Related Tools
- MBOX Viewer — Open and read MBOX mailbox archives online, securely in your browser
- EML Viewer — View individual EML email files extracted from MBOX archives
- DMARC Analyzer — Analyze DMARC reports to understand email authentication across your domain
- DNS Checker — Verify your domain's SPF, DKIM, and DMARC records
- iCal Viewer — View calendar files often found as attachments within archived emails
Share any email easily with a simple direct link in just one click.
Install EmailShot