Split a Gmail Takeout mbox into per-label folders of .eml files — Step-by-step guide
Gmail Takeout hides your labels in the X-Gmail-Labels header and importers collapse everything into one pile. LabelKeep reads that header and rebuilds proper per-label folders of .eml files, entirely in your browser.
What the sample produces
The demo MBOX holds 842 messages tagged across 31 labels, including nested labels like Work/Standups and mail carrying two labels at once. LabelKeep rebuilds the exact label tree as folders and writes each message as a standalone .eml, copying multi-label mail into every folder it belongs to.
- Folder structure
- 31 per-label folders
- Label data
- Read from X-Gmail-Labels
- Messages
- 842 preserved as .eml
How to use it
- In Google Takeout, export Mail and choose the .mbox format, then unzip to get the .mbox file.
- Open that .mbox (or .mbox.gz) here and check the label folders and message counts in the preview.
- Download the ZIP: each Gmail label is its own folder of .eml files, plus labels-index.csv. Import a folder into your mail client or open any .eml directly.
Supported files
Reads the X-Gmail-Labels header that Google Takeout writes (mbox format). A message with several labels is copied into each of its label folders so every folder is complete; labels-index.csv keeps the full mapping. Label names containing a comma are not supported (comma is Gmail's separator). Works up to about a 2 GB mbox in one pass — split larger exports in Takeout. Opening .mbox.gz needs a current browser (Chrome, Edge, Firefox, Safari).