MBOX Guides

How to Split a Large MBOX File By Size, Count, Year or Label, With Every Part Checked

Leena Taylor Paul By Updated September 27, 2026 7 min read
Quick Answer

Split the file into parts that stay under the size limit of the program that will import them. Cut only between two messages, never inside one. Keep each part under 4 GB for Thunderbird, under 2 GB for Apple Mail and under a few hundred megabytes for webmail uploads. Then count the messages before and after.

Thunderbird with a free add-on, a short Python script or a Windows desktop splitter can all do the split.

A mailbox export that is too large to import is a common problem after a Google Takeout download or a move away from an old mail program. The program on the other side refuses it because of a size limit. This guide shows three ways to split the file into smaller parts: Thunderbird with a free add-on, a Python script and the Univik MBOX Splitter desktop tool. It also gives a safe part size for each mail program and shows how to prove that no message was lost.

An MBOX split only at complete message boundaries into smaller parts, with the example parts below Thunderbird's 4 GB limit and a matching total count.
Part size depends on the receiving app: keep Thunderbird parts under 4 GB and Apple Mail parts under 2 GB.

Why Is an MBOX File Too Large to Import?

An MBOX file is too large to import when it passes a limit set by the program that reads it, not by the format. An .mbox file is plain text. Each message starts with a From line (the word From followed by a space). The format has no upper size. The programs that read it do. ImportExportTools NG (the free Thunderbird add-on that imports mbox files) refuses any file over 4 GB, as its bug reports on GitHub (issue 452) show. Apple Mail stops an export or an import near 2.15 GB.

Univik MBOX Splitter main window with a large mailbox listed by label
In the app: a big export opens in about a second and every message is listed by label on the left, so you can weigh the size before any split.

Google Takeout is the most common source of an oversized file. It writes every Gmail message, including Spam and Trash, into one file.

What Part Size Should You Pick for Smaller MBOX Files?

Pick a part size that stays under the smallest limit on the path the file will take. Leave a margin. A part of 3.9 GB passes a 4 GB check. A part of 4.0 GB may not, because programs count gigabytes in more than one way.

Where the parts will goKeep each part underReason
Thunderbird with ImportExportTools NG4 GBThe add-on skips any mbox over 4 GB. Source: the add-on's GitHub bug reports, issue 452.
A FAT32 USB stick or memory card4 GBFAT32 cannot store a single file over 4 GB.
Apple Mail (File > Import Mailboxes)2 GBExport and import stop near 2.15 GB. Source: Apple Support Community thread 250165788.
A webmail import pageA few hundred MBSome webmail importers cap a single upload at a few hundred megabytes.

Whatever size you choose, the cut has to fall between two messages. A message split across two files is broken in both. A good splitter looks for the next From line before it closes a part. A single message bigger than your limit gets a part of its own.

How Do You Split an MBOX File with Thunderbird or a Python Script?

You can split an MBOX file with free tools you may already have.

Route 1: Thunderbird and ImportExportTools NG. Install the add-on from Add-ons and Themes. Right-click a folder under Local Folders and pick ImportExportTools NG, then Import mbox file. Once the mail is in, move messages into subfolders by year or by sender. Then right-click each subfolder and use the add-on's export menu to save it as an mbox file. Each exported folder is one smaller part. The weak point is the first step. A source file over 4 GB will not import at all. Our guide on the Thunderbird larger than 4 GB message covers that case.

Route 2: the Python mailbox module. Python ships with a standard library module named mailbox. It reads an mbox file one message at a time. A short script adds each message to the current part and starts a new part when the byte count passes your limit. Because it works message by message, it never cuts inside one. f00b4r0/gmail-mboxsplitter splits a Takeout file by label. ryosama/mbox_spliter (Perl) splits by year, month, week or day. devgiants/mbox-splitter (PHP) splits by size for Roundcube upload limits. All of them need a command window and none of them checks that the parts add up.

How Do You Split a Large MBOX File on a Windows PC in Three Steps?

On a Windows PC a desktop splitter does the same work with no code. Univik MBOX Splitter works on Windows 11 or 10, 64-bit only. It opens .mbox files of any size, the zip parts from Google Takeout with no unzipping or a folder that holds many mbox files. On our test file, a 1.1 GB Takeout export with 913 messages opened in one second and used 10 MB of memory. There are seven split modes: by size, by message count, by Gmail label, by year, by month, by sender or by sender domain. For a file that is too large to import, split by size is the one you want. The 2 GB preset is marked as safe for Apple Mail and older programs. Keep conversations together puts a message and its replies in the same part.

1
Add the mailbox file
Start the splitter and add the .mbox file, the zip parts from Takeout or a folder full of mbox files.
2
Set the size limit
Choose Split by size and type the largest part you want, or pick the 2 GB preset for Apple Mail. Turn on Keep conversations together if replies should stay in the same part.
3
Pick the output folder and start
Choose where the parts should go. The tool creates an Output folder there, writes the parts in the original order, reads each one back and saves split-index.csv beside them.
Split the file on your own PC

Univik MBOX Splitter cuts a big mailbox file into parts under any size you choose, then reads each part back and writes an index.

Free Download See all features

How Can You Check That the Split MBOX Files Are Complete?

Check the split by counting messages in the source file and in all the parts together. The two totals must match. On Windows, PowerShell can count the From lines, one per message: Select-String -Path file.mbox -Pattern '^From ' -CaseSensitive | Measure-Object. On a Mac or Linux machine, grep -c '^From ' file.mbox gives the same number.

A desktop splitter can run this check for you. After it writes a part, it opens that part again and compares the message count and the content with the source. It also saves split-index.csv, one row per message with the position in the source, the output file, the date, the sender and the subject. The source file is never touched.

Key Takeaways
  • An .mbox file has no size limit of its own. The importing program does: 4 GB for ImportExportTools NG and FAT32 sticks, about 2 GB for Apple Mail.
  • Pick a part size under the smallest limit on the file's path and leave a margin.
  • A cut must fall between two messages. A message split across two files is broken in both.
  • Thunderbird and the Python mailbox module are free routes. Neither checks the result for you.
  • Univik MBOX Splitter splits by size, count, label, year, month, sender or domain on Windows and reads every part back.
  • Count the messages in the source and in all the parts before you import anything.

Most people do not need a clever split. They need parts that import, and proof that nothing fell out on the way. That is the whole job.

Nick Rogers, Founder of Univik
Nick Rogers
Founder, Univik
Windows mail tools since 2013

Large MBOX File Questions

Split it into parts under the limit of the program you are importing into. Sort mail into folders in Thunderbird and export each one, run a Python script built on the mailbox module or use a Windows desktop splitter in split by size mode.

Stay under the smallest limit on the file's path. ImportExportTools NG skips files over 4 GB and FAT32 sticks cannot hold a file that big. Apple Mail stops near 2.15 GB, so pick 2 GB there.

Yes, as long as every cut falls between two messages and no message is skipped. Prove it afterwards by counting messages in the source and in all the parts. The two totals must be the same.

It should not. Thunderbird imports a copy, a Python script writes new files and the Univik desktop splitter opens the source in read mode only.

Not directly. Thunderbird has no split command. You import the file, move messages into subfolders, then export each subfolder with ImportExportTools NG. The add-on refuses a source file over 4 GB.

Yes. Python's mailbox module can split by any rule you code. Free scripts on GitHub include f00b4r0/gmail-mboxsplitter for Takeout labels, ryosama/mbox_spliter for dates and devgiants/mbox-splitter for size. None of them checks the parts against the source.

Count the From lines in the source and in each part, then compare the totals. Open the first and last message of each part in a viewer to confirm the cut landed between messages. A desktop splitter that reads each part back does this check for you.
Leena Taylor Paul

Leena Taylor Paul wrote this guide with the Univik team, which has shipped Windows mail tools since 2013. This guide keeps to the three ways that work on a normal PC and says which part size each mail program accepts. Last checked September 2026. Stuck with a file that will not import? Contact our support team.