Export Gmail emails to Excel
Three methods, from “no setup” to “set once and forget”. Each has a real limitation — here is which one fits your case.
Method 1 — Google Takeout (no setup, not a spreadsheet)
Takeout gives you a full archive as MBOX files. It is the safest way to get all mail out of Google, but it is not Excel: you get one big file per label and then need a parser.
- Open
takeout.google.com, select Mail only. - Choose “Export once”, download the ZIP (can take hours for large mailboxes).
- Convert MBOX to CSV with a script or a converter — this is where most people get stuck.
Best for: full backup, legal hold, migration. Worst for: “I need a table of senders and dates today”.
Method 2 — IMAP + app password (repeatable)
Gmail supports IMAP, but not with your normal password: you need an app password (requires 2-step verification) — or OAuth for Workspace accounts.
- Google Account → Security → 2-Step Verification → App passwords.
- Create a password for “Mail”, copy the 16-character code.
- Use it with
imap.gmail.com, port 993, SSL.
import imaplib, email
imap = imaplib.IMAP4_SSL("imap.gmail.com")
imap.login("you@gmail.com", "your-16-char-app-password")
imap.select("INBOX", readonly=True)
status, data = imap.search(None, '(SINCE 01-Sep-2026)')
for num in data[0].split()[:50]:
status, msg_data = imap.fetch(num, "(RFC822)")
msg = email.message_from_bytes(msg_data[0][1])
print(msg["Date"], msg["From"], msg["Subject"])
This is the method that scales: you control which folders, which date range and which fields you get.
Method 3 — ready script (no coding)
If you do not want to write code, use a prepared Python script that already handles folders, date filters, text decoding and Excel output. It runs locally — mail never goes to a third-party server.
Get the script — $3 in USDT · what exactly is inside
Gmail-specific limits worth knowing
- Labels are not folders: a message can be in several labels at once.
- IMAP shows Gmail’s “All Mail” plus label folders — filter carefully to avoid duplicates.
- Large attachments may be split across parts — your parser must handle multipart messages.
- OAuth is mandatory for some Workspace admins; app passwords may be disabled by policy.
FAQ
Can I export Gmail to Excel for free?
Yes. Google Takeout is free but gives MBOX archives, not spreadsheets. IMAP with an app password is also free if you write or use a script.
Why does my Gmail password not work with IMAP?
Google blocks normal passwords for IMAP. You need an app password, which requires 2-step verification, or OAuth for Workspace accounts.
Does this work for Google Workspace?
Yes, but the admin may disable app passwords. In that case use OAuth, or export via Takeout and parse the MBOX file.
How long does exporting 10,000 emails take?
IMAP fetch is roughly 3–10 messages per second, so about 20–50 minutes. Takeout may take hours because it archives everything.
Related guides
- IMAP → Excel for any providerThe same method for Outlook, Yandex and corporate mail.
- Convert email to CSVWhen you need CSV for CRM or a database.