Where apps hide your files
Safari's bookmarks, history and tabs are plain files in your Library, but macOS blocks apps from reading them by default. Here are the exact names, the permission step, and Safari's own export, which now covers history too.
~/Library/Safari/
The two files most people want are in there:
~/Library/Safari/Bookmarks.plist
~/Library/Safari/History.db
Bookmarks.plist holds bookmarks, the Reading List and the Favorites folder. History.db is a SQLite database of visited pages. Both, and the files below, were checked on a Mac running Safari 26.2 on macOS 15 Sequoia.
| Item | What it is |
|---|---|
History.db, History.db-wal, History.db-shm | History database and its write-ahead files. Keep the three together |
Bookmarks.plist | Bookmarks and Reading List |
AutomaticBookmarksBackup.html | An occasional HTML backup of your bookmarks |
Downloads.plist | The list behind the Downloads popover (the downloaded files are elsewhere) |
TopSites.plist | Frequently visited sites for the start page |
LastSession.plist, RecentlyClosedTabs.plist | Tabs to restore and the Reopen Closed Tab list |
Favicon Cache/ | Site icons |
LocalStorage/ | Data that sites store in the browser |
CloudTabs.db and other *.db files | iCloud tab and sync bookkeeping |
Tab groups live in Safari's sandbox container instead. On the Mac checked, SafariTabs.db sat here:
~/Library/Containers/com.apple.Safari/Data/Library/Safari/
If you use Safari profiles, note that Apple's export treats history and extensions as belonging to each profile, while bookmarks are shared. Apple does not document where per-profile files live on disk, so use the export below rather than hunting for them.
Since macOS Mojave, ~/Library/Safari is protected. Terminal reports Operation not permitted, and other apps that try to read it get nothing. To let Terminal read it, open System Settings > Privacy & Security > Full Disk Access, add Terminal, then quit and reopen it. Only grant this to apps you trust, since it opens your mail and messages too.
To open the folder in Finder, use Go > Go to Folder (⇧⌘G) and paste ~/Library/Safari.
Reading the files directly is the fallback. These are better:
If you copy History.db to examine it, quit Safari first and copy the -wal and -shm files with it. Opening the live file with another tool while Safari runs can lock it.
Safari's data is small. The whole ~/Library/Safari folder was about 14 MB on the Mac checked. The web cache is a separate folder, which was a few hundred kilobytes there because that Safari is rarely used:
~/Library/Caches/com.apple.Safari/
Inside it, WebKitCache is the part that grows. To clear history without touching files, choose History > Clear History and pick how far back to go. That is safer than deleting History.db, which Safari expects to exist, and if Safari uses iCloud the history is cleared on your other devices too. Do not delete Bookmarks.plist unless iCloud has a good copy: AutomaticBookmarksBackup.html is written only now and then, so check its date before you count on it.
Migration Assistant carries this folder across. Time Machine also backs up ~/Library/Safari, and you can restore single files from it. For a manual copy, quit Safari, copy Bookmarks.plist and the history trio, and place them in the same folder on the new Mac with Safari closed. Turning on iCloud sync for Safari is the least fragile choice for ongoing protection.
Spotlight does not show results from ~/Library, and Safari's folder is further shielded by the privacy rules above, so "Bookmarks" or "History" searches find only the exported copies you made yourself.
History.db is an ordinary SQLite database, so you can inspect a copy with the sqlite3 tool that ships with macOS. Work on a copy on your Desktop, never on the live file. The tables of interest are history_items (one row per address) and history_visits (one row per visit, with a timestamp). Safari stores times as seconds since 1 January 2001, not the usual Unix epoch, so dates look wrong until you add 978307200 seconds. These table names are long-standing, but check them with .tables on your own copy in case your version differs.
History is private. Anything you copy out of the folder carries every address you visited, so delete the copy when you are done.
Everywhere matches file names, so typing History.db lists the live database next to any copies you made, and typing Bookmarks turns up Bookmarks.plist along with old HTML exports you forgot about. It needs Full Disk Access to see inside ~/Library/Safari, the same permission Terminal needs above, and it finds files without reading what is in them. ⌘↵ reveals a result in Finder.
It is ~/Library/Safari/Bookmarks.plist. Safari also writes an occasional HTML backup beside it, AutomaticBookmarksBackup.html.
In ~/Library/Safari/History.db, a SQLite database, with History.db-wal and History.db-shm beside it while Safari runs.
macOS protects it. Add Terminal under System Settings > Privacy & Security > Full Disk Access, then quit and reopen Terminal.
Choose File > Export Browsing Data to File and tick bookmarks and history; Safari saves a ZIP archive. For bookmarks alone, File > Export > Bookmarks writes an HTML file.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised