How to export iMessages and iPhone SMS to a file
Apple has no export of messages. They live in a database: chat.db on a Mac, sms.db in an iPhone backup. ChatExhibits opens either one in your browser. Here is how to get the file.
By Martin Ferret · Published · Last updated
On a Mac: copy chat.db
- 1For your full history, turn on Messages in iCloud: in Messages, Settings, then iMessage, Enable Messages in iCloud, and let it sync.
- 2Quit Messages, so the latest messages are written to the database.
- 3In Finder, choose Go, then Go to Folder, and type ~/Library/Messages.
- 4Copy chat.db to your Desktop. To include photos, copy the Attachments folder too and zip both together.
If macOS asks whether to give access to that folder, Apple explains what this permission does.
From an iPhone: an unencrypted backup
- 1Connect the iPhone to the computer with a cable and trust the computer.
- 2On a Mac, open Finder and select the iPhone; on Windows, open the Apple Devices app.
- 3Leave Encrypt local backup unticked, then click Back Up Now and wait for the end.
- 4Open the backup folder: ~/Library/Application Support/MobileSync/Backup on a Mac, or Apple\MobileSync\Backup in your user folder on Windows.
- 5Zip the backup’s folder and drop it on ChatExhibits, or drop the file 3d0d7e5fb2ce288813306e4d4636395e047a3d28 from its 3d folder.
With iMazing (CSV)
- 1In iMazing, select your iPhone, then Messages, and click Start.
- 2Select the conversation, then Export, then Excel or CSV.
- 3Keep the header row and the chat session name, then choose where to save.
Good to know
- An encrypted backup cannot be read. Turning encryption off asks for the backup’s password.
- Attachments kept only in iCloud are not on the computer and cannot be included.
- The database names nobody as the phone’s owner; you type your name once in ChatExhibits.
Sources
- Apple, Messages User Guide for Mac, Set up Messages, read on
- Apple, If an app asks for Full Disk Access, read on
- Apple, How to back up your iPhone or iPad with your Mac, read on
- Apple, Back up your iPhone using Apple Devices on Windows, read on
- Apple, About encrypted backups on your iPhone, read on
- Apple, Locate backups of your iPhone, read on
- iMazing, How to export iPhone text messages as PDF, Excel, CSV or RSMF, read on
Common questions
Is it safe to give my Messages database to a website?
The file is opened inside your browser and never sent anywhere. Still, it holds every conversation on the device, so keep the copy somewhere private and delete it afterwards.
Why are recent messages missing?
While Messages is open, recent messages may sit in a side file. Quit Messages, wait a moment and copy chat.db again.
Can I use an iCloud backup?
No. An iCloud backup is not a file on your computer. Make a backup on the computer, without encryption.
Keep reading
- Export a WhatsApp Chat on iPhone or AndroidStep-by-step export instructions for iPhone and Android, what “Attach Media” changes, what WhatsApp Desktop can export, and what ends up inside the ZIP.
- WhatsApp Export Format: the TXT and ZIPWhat is inside a WhatsApp export: the two timestamp formats, the invisible direction marks, attachment lines on iOS and Android, and how media is named.
- What Is Bates Numbering? Format, ContinuityWhere the name comes from, what a Bates number looks like, why it runs continuously across a production, and what stamping one does not accomplish.
- SHA-256 File Integrity: Is a File Unchanged?What a hash is, why changing one byte changes the whole digest, how to compute one on macOS, Windows and Linux, and what a digest cannot tell you.
- WhatsApp Chat to PDF for CourtTurn a WhatsApp export into a dated, page-numbered PDF with a SHA-256 certificate, read in your browser. Made for people who need to show what was said.
- Android SMS to PDF as EvidencePrint Android text messages from an SMS Backup & Restore file as a dated, numbered PDF with photos and a certificate. Nothing is uploaded.
- Messenger Messages as Evidence, in a PDFTurn the Messenger conversation in your Facebook data download into a dated, numbered PDF with photos, reactions and a SHA-256 certificate.
- Instagram Messages as Evidence, in a PDFPrint an Instagram direct message conversation from your data download as a dated, numbered PDF with its photos and a certificate, in your browser.
- Telegram Chat to PDF for CourtTurn a Telegram Desktop export, JSON or HTML, into a dated, page-numbered PDF with photos, voice messages and a SHA-256 certificate.
- Export iMessage to PDF for CourtTurn iMessage and iPhone SMS from a Mac or an unencrypted iPhone backup into a dated, numbered PDF with a certificate, read in your browser.
- How to Export Android Text MessagesExport Android SMS and MMS to a file with SMS Backup & Restore or SMS Import / Export, step by step, then copy it to your computer.
- How to Download Your Messenger MessagesDownload your Messenger conversations with Export your information, in JSON, plus the backup of end-to-end encrypted chats, step by step.
- How to Download Your Instagram MessagesDownload your Instagram direct messages with Export your information, in JSON, step by step, with how long it takes and what is left out.
- How to Export a Telegram ChatExport a Telegram chat or all your data from Telegram Desktop, in machine-readable JSON, step by step. The phone apps have no export.
- Messages as Evidence: What to KnowWhat the rules in France, the United States and Spain say about messages as evidence, with sources, and what ChatExhibits does not replace.