Export your mail from Gmail with Takeout
Google Takeout exports your Gmail mail as a single .mbox file. Go to
takeout.google.com, select only Mail, create the export and
download the archive when Google emails you the link. Extract the archive and open the .mbox
file in Mbox Viewer. The labels, the read state, the stars and the conversations come with it.
How do I create the export?
- Open takeout.google.com and sign in to the Google account whose mail you want.
- Click Deselect all, then tick Mail.
- Optional: click All Mail data included and keep only the labels you want.
- Click Next step.
- Choose the delivery method, for example a download link sent by email, and choose to export once.
- Pick the file type (
.zipor.tgz) and the largest file size offered, so that the mail fits in one archive. - Click Create export.
Google prepares the archive in the background. A large mailbox can take hours or days. Google sends an email when the archive is ready, and the download is available for a limited time.
Where is the mbox file in the archive?
Extract the archive. The mail is in the Takeout/Mail/ folder. The file has a name such as All mail Including Spam and Trash.mbox. The exact name depends on the language of your Google
account.
Mbox Viewer names the mailbox after the file and drops the extension. Rename the file before you
open it if you prefer a shorter name such as Gmail 2026.mbox. Then open it as described in
Open your first mbox.
What does Mbox Viewer read from a Gmail export?
| Gmail data | Stored by Takeout as | In Mbox Viewer |
|---|---|---|
| Labels | X-Gmail-Labels header |
Labels section of the sidebar, label: operator |
| Conversations | X-GM-THRID header |
Conversation list under the open message |
| Unread, starred, important | Labels Unread, Starred and Important | is:unread, is:read, is:starred, is:important |
| Inbox, sent, drafts, spam, trash | System labels | in:inbox, in:sent, in:drafts, in:spam, in:trash |
| Categories | Labels such as Category Social | label:"Category Social" |
| Nested labels | Label names with / |
label:Projects/Atlas |
A click on a label in the sidebar shows only its messages. A second click shows everything again.
in:anywhere matches every message, including spam and trash.
Which searches are useful on a Gmail export?
| Goal | Query |
|---|---|
| Leave spam and trash out | -in:spam -in:trash |
| Messages you sent | in:sent |
| Starred messages with an attachment | is:starred has:attachment |
| Unread messages from one sender | is:unread from:alice |
| One label over one year | label:Invoices after:2025/01/01 before:2026/01/01 |
Every other operator is in the Operators reference. To keep a set of results, save them in one of your virtual folders.
What if I export again later?
A new Takeout export is a new file. Open it as a new mailbox, or replace the old file with it at the same path and choose Reindex. Tags and virtual folders are tied to the Message-ID of each message, so they come back on messages that are still in the new export.
Frequently asked questions
Does Google Takeout export Gmail as an mbox file?
Yes. Takeout exports the Mail product as one .mbox file inside a .zip or .tgz archive. The file sits in the Takeout/Mail/ folder of the archive.
Are my Gmail labels kept in the export?
Yes. Takeout writes the labels of each message into an X-Gmail-Labels header. Mbox Viewer lists them under Labels in the sidebar with their message counts, and you can search them with label:.
How long does Google take to prepare the export?
Google decides the delay, which ranges from minutes for a small mailbox to hours or days for a large one. Google sends an email with the download link when the archive is ready.
Does the export include spam and trash?
Yes, when you export all mail. Add -in:spam -in:trash to a search in Mbox Viewer to leave those messages out of the results.
Can I export only some labels?
Yes. In Takeout, click All Mail data included under Mail and tick only the labels you want. The export then holds only the messages that carry those labels.
Does Mbox Viewer know which messages were unread or starred?
Yes. Takeout exports these states as the labels Unread, Starred and Important. Search is:unread, is:starred or is:important to find them, and is:read for messages without the Unread label.
Can Mbox Viewer open a Gmail export of several gigabytes?
Yes. The app reads the file as a stream and was built for multi-gigabyte Takeout exports. Indexing happens once, and later openings of the same file are instant.
Does opening the export change anything in my Gmail account?
No. Mbox Viewer works on the file on your computer and never connects to Gmail. Nothing you do in the app, such as tagging or filing messages, reaches your account.
Are conversations kept together?
Yes. Takeout writes the Gmail thread identifier into each message. Mbox Viewer uses it to list the messages of a conversation below the open message.
My Gmail is in French. Do the system labels still work?
Yes. The is: and in: operators recognise the English names and the French names of the system labels, such as "Boîte de réception" for the inbox or "Non lus" for unread messages.