How to Read Gmail Offline
Before going offline, save messages to your device so you can read Gmail without an internet connection. Gmail’s built-in offline mode does this in Chrome on a computer; the Gmail mobile apps have their own synchronization settings. Offline search only finds messages already saved to that device.
To keep a separate copy of your mail as files on your computer, use mailmd, a free, open-source tool. It saves email as Markdown files. Unlike Gmail’s temporary browser storage, these files let you read your mail without opening Gmail.
Set up Gmail offline in Chrome #
Set up Gmail’s built-in web offline feature in a regular Google Chrome window with an internet connection. In Gmail, open Settings → See all settings → Offline and select Enable offline mail. Then choose how much mail to download to Chrome for offline reading, and select Save changes. Google Workspace settings document 7-, 30-, or 90-day history options, with 30 days as the default. A work or school administrator may need to allow offline Gmail.
Keep Chrome open while messages download. If you use more than one Gmail account, enable offline mail separately for each. Before disconnecting, test your setup. Turn off your internet connection and reopen Gmail. Then try reading a needed message and searching for another. Google notes that offline search covers only synchronized messages, and its Gmail offline instructions explain how to check storage and fix common problems.
Gmail does not preview attachments offline. Download files you will need before you leave, then open them with software on your computer. Replies written offline wait in the Outbox and send after the connection returns; they are not delivered while the device is disconnected.
Sync mail on a phone #
On Android, open the Gmail app and go to Menu → Settings → select your account → Days of mail to sync. Gmail stores synchronized messages on the device; messages outside the synced range are unavailable offline. You can also adjust label synchronization and attachment downloads in the app’s settings. See Google’s Android Gmail settings.
On iPhone or iPad, choose how far back Gmail syncs messages under Menu → Settings → General → Data usage → Sync settings. Google also recommends enabling Background App Refresh in iOS settings. Test the messages and files you need while connected, because the documented iOS settings do not guarantee that every attachment will be available offline. The iPhone and iPad sync instructions provide the current path.
Keep a local copy with mailmd #
Use Gmail’s Chrome feature for quick access to synchronized mail inside Gmail. To read saved mail without opening Gmail, use mailmd. It saves each message as a Markdown file, with attachments beside it. It works with Gmail, Outlook, iCloud, and other IMAP mailboxes. It only reads mail and does not change or delete messages in the mailbox.
On macOS, Linux, or Windows in Git Bash, install and sync from a terminal:
curl -fsSL https://raw.githubusercontent.com/vincentsch/mailmd/main/install.sh | sh
mailmd connect gmail --client-secret client_secret.json
mailmd syncTo connect through Gmail’s API, set up an OAuth app in Google Cloud. This app lets Google authorize mailmd to access your account. For Gmail through IMAP, use mailmd connect imap --email you@example.com; Gmail requires an app password for this route. After mailmd downloads your messages, the files are in ~/mail/<account>. Open them in an editor or note app, or search them with rg or grep. See the mailmd setup instructions.
The archive stays on your computer, but mailmd does not encrypt saved login details, and anyone using your computer account can read those details. It also does not delete mail from Gmail or provide a mail-reading interface of its own. Keep the archive on a device you control and include its folder in your normal backup.
Free and open source
Try mailmd
mailmd is a free command-line tool that copies your email into Markdown files on your computer, one file per message. It works with any IMAP mailbox, and with Gmail and Outlook through their own APIs.
Install
$ curl -fsSL https://raw.githubusercontent.com/vincentsch/mailmd/main/install.sh | sh
Set it up with your coding agent
Set up mailmd so you can read my email. Use https://github.com/vincentsch/mailmd: read its AGENTS.md and follow the steps. Connect my mailbox and run the first sync. Then show me where the files are.