How to Use Google Takeout to Analyze and Declutter Your Inbox
If you want to know who is actually filling your Gmail, there are two ways to find out. One is to export everything with Google Takeout and count senders in the resulting file. The other is to let a tool ask Gmail directly. This guide covers the Takeout route in full, including the parts that surprise people, and then explains when the faster route makes more sense.
Takeout is worth knowing regardless. It is the only way to get a complete local copy of your email, and a copy is a sensible thing to have before you delete thousands of messages.
Step 1: Export your mail with Google Takeout
- Go to takeout.google.com and sign in.
- Click Deselect all. Takeout defaults to exporting every Google product, which makes the archive far bigger than you need.
- Check Mail only.
- Click All Mail data included and leave everything selected unless you want just certain labels. Keep Include all messages in MBOX format.
- Click Next step. Choose Export once.
- Set the archive size to the largest option, 50GB. Smaller sizes split your mailbox across several files, which makes the next steps harder.
- Click Create export.
Google emails you when the archive is ready. For a small account that can be under an hour. For an account with years of mail and attachments, Google's own estimate is "hours or possibly days," and it is not unusual for a 20GB mailbox to take most of a day. Start it in the evening and check the next morning.
Step 2: Download and extract
The download link expires after seven days, so do not leave it. A large export arrives as a compressed archive that is somewhat smaller than your mailbox, and expands to roughly the size of your mail once extracted, so make sure you have the disk space.
After extracting, open the Takeout/Mail folder. The file you want is:
All mail Including Spam and Trash.mbox
That single file holds every message, in MBOX format, which is plain text with each email one after another. It opens in a text editor in theory. In practice, a multi-gigabyte text file will stall most editors, so do not double-click it.
Step 3: Find your biggest senders
This is the actual goal: a ranked list of who sends you the most. Three ways, from least to most technical.
Option A: ChatGPT (works for small inboxes or samples)
ChatGPT accepts uploads up to 512MB per file. Most full Gmail exports are larger than that, so this only works if your inbox is small, or if you split the file and analyze a sample.
If your MBOX fits, upload it and use a prompt like:
This is a Gmail MBOX export. List the 30 most frequent senders by email
address with their message counts, flag which look like newsletters or
automated notifications, and note any senders whose messages appear to
carry large attachments.
If it does not fit, split it first (Option B shows how) and run the prompt on one chunk. You will get a partial picture, which is often enough to spot the top ten offenders.
Option B: a one-line count (works for any size)
Every message in an MBOX file has a line starting with From:. Counting those lines by address gives you the sender ranking directly, with no size limit. On a Mac or Linux terminal:
grep -h "^From: " "All mail Including Spam and Trash.mbox" | sort | uniq -c | sort -rn | head -50
On Windows, the same idea works in PowerShell:
Select-String -Path "All mail Including Spam and Trash.mbox" -Pattern "^From: " | ForEach-Object { $_.Line } | Group-Object | Sort-Object Count -Descending | Select-Object -First 50 Count, Name
To split the file into 500MB pieces for Option A: split -b 500m "All mail Including Spam and Trash.mbox" chunk_
Option C: a mail client
Thunderbird can import an MBOX file (via the ImportExportTools NG add-on) and then sort by sender. It is slow to import a big mailbox, but once loaded you get a normal mail interface for browsing what you found.
Step 4: Act on what you found
Takeout gives you the list. Acting on it happens back in Gmail:
- Unsubscribe from the newsletters and notifications you never open. Gmail shows an Unsubscribe link next to the sender name on most of them. See how to unsubscribe from emails in Gmail.
- Delete the backlog by sender. Search
from:and the address, click the select-all checkbox, click Select all conversations that match this search, delete. See how to delete all emails from one sender. - Filter or block the senders you never want again. Settings, Filters and Blocked Addresses, Create a new filter.
- Empty Trash. Deleted mail keeps counting against your storage until you do.
What the Takeout route really costs
Adding it up for a typical large inbox:
- Waiting for Google to build the export: several hours to a day
- Downloading and extracting a multi-gigabyte archive: 30 to 60 minutes
- Getting a sender ranking out of the file: a few minutes with the one-liner, an hour or more with ChatGPT and splitting
- Going back to Gmail to search and delete each sender by hand: an hour or two
It works. It is also a lot of ceremony to answer one question, and the export is stale the moment it finishes, so you cannot easily repeat it next month.
The faster route
MailMop answers the same question without the export. It connects to Gmail through Google's API, analyzes the inbox in your browser, and lists every sender ranked by email count, with the date of their last email. A 25,000-email inbox takes about ten minutes, and results appear as it goes. From that list you delete, delete with exceptions, unsubscribe, block, mark as read, or label a whole sender in one click.
Nothing is downloaded and nothing is uploaded. Your email is processed in the browser tab and never stored on a server. The code is open source and the app passed Google's CASA security assessment. The analysis is free.
| Google Takeout | MailMop | |
|---|---|---|
| Wait for export | Hours to a day | None |
| Download | Multi-gigabyte archive | None |
| Sender ranking | Script or ChatGPT | Built in |
| Act on results | Back in Gmail, one sender at a time | From the same list, in bulk |
| Repeatable | Start over each time | Re-run any time |
When Takeout is still the right tool
- You want a backup. Before a large cleanup, a Takeout export is the only complete local copy. Do it, then clean.
- You need mail you already deleted. Takeout includes Trash at export time, but nothing older than 30 days in Trash. If it is gone from Gmail, it is gone from Takeout too.
- You are leaving Gmail. MBOX imports into most other mail systems.
- You want to study the data. For research on your own email patterns, the raw file is the right input.
For the everyday question of who is cluttering your inbox and what to do about it, run the analysis in the browser, keep Takeout for the backup, and spend the saved afternoon on something else.