MBOX Splitter

Paste an mbox export and split it into the individual messages it holds — each a ready-to-save .eml with a suggested filename. Preview an index first, pull out a single message, or get JSON, all in your browser.

Try:
Split messages

About this tool

An mbox file is one long text file holding many emails end to end. Mail clients and export services — Thunderbird, Apple Mail, Gmail Takeout, mailing-list archives — all hand you a single .mbox, which is awkward when you only want one message, or when the thing you need to open the mail with expects one file per message. This tool splits the archive back into the individual messages it contains, each a ready-to-save .eml with a suggested filename.

Messages are separated the classic way: a From postmark line at the start of a line. The space after From is what distinguishes the separator from a From: header, so header lines never split a message by mistake. Each message is then sliced out verbatim — headers, MIME structure, and base64 attachments are copied byte for byte, never re-serialized — so what you save is a faithful copy of the original mail. The postmark line itself is dropped by default, because a .eml file is a bare RFC 5322 message; turn on Keep the From postmark line if you want to reassemble an mbox later.

Four things you can ask for:

Filenames follow whichever scheme you pick — numbered, subject, date, or Message-ID — and always keep the 001- index prefix so the original archive order and filename uniqueness survive. Subjects written as RFC 2047 encoded words (=?utf-8?q?Caf=C3=A9?=) are decoded first and then slugged to portable lowercase ASCII.

Exporters escape body lines that begin with From by writing >From (the mboxo/mboxrd convention). Undo >From body quoting is on by default so bodies match the message as sent; switch it off if you want the archive bytes exactly as they were stored.

Everything runs locally in your browser as WebAssembly — the archive is never uploaded.

Limits: one run splits at most 2000 messages, and input arrives as text through the field above, so a multi-gigabyte export should be cut down first. The tool returns text, not a ZIP of files: to save a single message, choose One raw message only with a message number and use the Download link, then rename the downloaded file to .eml.

Worked example

Input:

From [email protected] Mon Sep 03 10:00:00 2018
From: Alice <[email protected]>
Subject: Quarterly report
Message-ID: <[email protected]>
Date: Mon, 3 Sep 2018 10:00:00 +0000

Numbers attached.

From [email protected] Mon Sep 03 11:30:00 2018
From: Bob <[email protected]>
Subject: Lunch?
Message-ID: <[email protected]>
Date: Mon, 3 Sep 2018 11:30:00 +0000

One o'clock?

With Index of what is inside and date filenames, the output is:

2 message(s)

  1. 001-2018-09-03-1000.eml
     date:    2018-09-03T10:00:00+00:00
     from:    [email protected]
     subject: Quarterly report
     size:    141 bytes

  2. 002-2018-09-03-1130.eml
     date:    2018-09-03T11:30:00+00:00
     from:    [email protected]
     subject: Lunch?
     size:    124 bytes

Switching to One raw message only with message 2 returns Bob's message on its own, starting at From: Bob <[email protected]> — no postmark, no other mail.

FAQ

How does the tool know where one message ends and the next begins?

It splits on the mbox postmark: a line starting with From — the word From followed by a space — at column 0. That is the separator every mbox writer emits. A From: header has a colon instead of a space, so it is never mistaken for a separator. If your text has no postmark at all, it is treated as a single message, which means a lone .eml pasted in still works.

Are attachments and formatting preserved?

Yes. Each message is copied out of the archive verbatim, including MIME boundaries, Content-Type headers, and base64-encoded attachment parts. The tool only reads the Subject, Date, and Message-ID headers, and only to build the suggested filenames — it never rewrites the message. Saving one of the output blocks as a .eml gives you a file your mail client can open with attachments intact.

Can I download every message as separate files or a ZIP?

Not from this page — it produces text, so a multi-file download has nowhere to go. What you can do is choose One raw message only, set the message number, and use the Download link to save that message (rename it from .txt to .eml). For a whole archive, the .eml text mode prints every message under a labelled header, which you can save once and split with a script, or run the command-line version once per message and redirect the output.

What does the `>From ` option do?

Because a body line beginning with From would look like a message separator, mbox writers escape it as >From (and an already-escaped >From becomes >>From ). Leaving Undo >From body quoting on strips one level of that quoting so the body reads as it was sent. Turn it off when you want to see the stored bytes unchanged — for example when comparing against the original file.

Should I keep the postmark line?

Keep it off if you are producing .eml files: an .eml is a bare RFC 5322 message and the postmark (From sender Mon Sep 03 10:00:00 2018) is an mbox container artifact that some mail clients display as junk. Turn it on when you want each piece to be a valid one-message mbox — for instance if you plan to concatenate a subset back into a smaller archive.

Why did I get a message-count error?

Two caps guard the browser. An archive with more than 2000 messages is rejected outright — split the file first. And asking for a single message number larger than the archive holds is an error that tells you how many messages there actually are, so you can pick a valid one; use 0 to get every message.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool mbox-splitter "From [email protected] Mon Sep 03 10:00:00 2018
From: Alice <[email protected]>
Subject: Quarterly report
Message-ID: <[email protected]>
Date: Mon, 3 Sep 2018 10:00:00 +0000

first body

From [email protected] Mon Sep 03 11:00:00 2018
From: Bob <[email protected]>
Subject: Lunch?
Message-ID: <[email protected]>
Date: Mon, 3 Sep 2018 11:30:00 +0000

second body"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/mbox-splitter/?mbox=From%20alice%40example.com%20Mon%20Sep%2003%2010%3A00%3A00%202018%0AFrom%3A%20Alice%20%3Calice%40example.com%3E%0ASubject%3A%20Quarterly%20report%0AMessage-ID%3A%20%3Ca1%40example.com%3E%0ADate%3A%20Mon%2C%203%20Sep%202018%2010%3A00%3A00%20%2B0000%0A%0Afirst%20body%0A%0AFrom%20bob%40example.com%20Mon%20Sep%2003%2011%3A00%3A00%202018%0AFrom%3A%20Bob%20%3Cbob%40example.com%3E%0ASubject%3A%20Lunch%3F%0AMessage-ID%3A%20%3Cb2%40example.com%3E%0ADate%3A%20Mon%2C%203%20Sep%202018%2011%3A30%3A00%20%2B0000%0A%0Asecond%20body&output=files&naming=index&message=0&unescape_from=true&keep_postmark=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.