Where Messages keeps your texts on a Mac

Messages on the Mac stores your conversations in one database file, chat.db, in the Messages folder of your user Library: ~/Library/Messages/chat.db. Photos, videos and other attachments are in ~/Library/Messages/Attachments. macOS protects this folder: only apps you give Full Disk Access can read it.

Updated

The files

File or folderWhat it holds
chat.dbAn SQLite database: every message, conversation, phone number and email address, and the links to attachments
chat.db-wal, chat.db-shmWorking files SQLite uses for recent changes not yet merged into chat.db. The three belong together; copy all of them or none
Attachments/Photos, videos, voice messages and files, in numbered folders

How to open the folder

  1. In the Finder, choose Go › Go to Folder… (⇧⌘G).
  2. Type ~/Library/Messages and press Return.
  3. Look, but don't move, rename or edit anything: Messages uses these files all the time.

What is inside chat.db

If you are comfortable in Terminal, you can look without changing anything: give Terminal Full Disk Access, then run sqlite3 -readonly ~/Library/Messages/chat.db "select count(*) from message;". Reading the actual texts takes decoding that plain SQL can't do.

Reading it safely

An app that wants your messages needs only to read these files. Textbound opens chat.db in read-only mode, in place, so it can't change it, makes no copy of it, and decodes the text with its own decoder. It reads Contacts the same way, to show names next to numbers. It shows each conversation as it looks in Messages and exports it as a PDF, a web page or a CSV. Nothing is uploaded.

Download for Mac — free

Free for the newest 100 messages of any conversation · macOS 14 or later

Questions

Where are iMessage attachments stored on a Mac?

In ~/Library/Messages/Attachments, in numbered folders. Files kept only in iCloud aren't there until Messages downloads them.

Can I copy chat.db to another Mac?

It isn't a good way to move messages: the database belongs to that Mac's Messages, and a copy made while Messages runs can be incomplete. Turn on Messages in iCloud, or move everything with Migration Assistant.

Why can't an app read my messages without Full Disk Access?

macOS keeps the Messages folder off-limits to every app, Terminal included, until you allow it in System Settings › Privacy & Security › Full Disk Access. That protects your messages from apps you didn't choose.

Is chat.db included in a Time Machine backup?

Yes, Time Machine backs up your Library, Messages included. A backup can be restored, but it isn't a copy you can read; for that, export the conversations you want.

Where are messages stored with Messages in iCloud on?

In iCloud, and on each device that has them. chat.db is then the Mac's local copy, kept in step with iCloud.

Open your Messages history in Textbound

Related: Full Disk Access, explained · back up your iMessages · get iPhone messages on the Mac