Where Safari Stores History.db and Bookmarks.plist on macOS
This article provides the exact file system locations for the Safari
web browser's History.db SQLite database and
Bookmarks.plist file on macOS. Additionally, it covers the
straightforward steps required to access this hidden directory via
Finder or the Terminal, as well as how to resolve the default macOS
privacy permissions that restrict direct access to these specific user
files.
The Exact File Locations
Safari stores both its browsing history and bookmarks data inside the current user's hidden Library folder.
The base directory is: ~/Library/Safari/
Depending on your macOS username, the full absolute path on the file
system is: /Users/<YourUsername>/Library/Safari/
Within this directory, you will find both files:
- Browsing History:
~/Library/Safari/History.db - Bookmarks and Reading List:
~/Library/Safari/Bookmarks.plist
How to Access the Files via Finder
Because macOS hides the user Library folder by default
to prevent accidental modifications, you cannot simply click through
your home folder to find it. Follow these steps to go directly to the
folder:
- Open Finder.
- Press Command + Shift + G on your keyboard to open the "Go to Folder" dialog box.
- Type
~/Library/Safari/and press Return.
Alternatively, you can open Finder, click on the Go menu in the top macOS menu bar, and hold down the Option (Alt) key. This will reveal the hidden Library option in the dropdown menu. Click it, then navigate to the Safari folder.
Bypassing macOS Permission Restrictions
On modern versions of macOS, the ~/Library/Safari/
directory is protected by macOS Transparency, Consent, and Control
(TCC). If you attempt to access History.db or
Bookmarks.plist using the Terminal or a third-party
database viewer, you will likely encounter an "Operation not permitted"
error.
To read or copy these files, you must grant Full Disk Access to the application you are using to access them:
- Open System Settings (or System Preferences on older macOS versions).
- Navigate to Privacy & Security.
- Scroll down and select Full Disk Access.
- Click the + icon at the bottom of the list (you may need to authenticate with your password or Touch ID).
- Add the Terminal app (or your preferred SQLite browser/text editor) to the list and ensure the toggle switch next to it is turned on.
- Restart the application you just granted access to.
Important File Handling Notes
If you plan to copy or parse these files, keep the following technical behaviors in mind:
- History.db Write-Ahead Logging: While Safari is
open, you will also see
History.db-shmandHistory.db-walin the same folder. Safari uses SQLite Write-Ahead Logging, meaning the most recent history entries are stored in the-walfile before being committed to the main.dbfile. Completely quit Safari (Command + Q) before copyingHistory.dbto ensure all recent data is merged into the main database file. - Bookmarks.plist Formatting: The
Bookmarks.plistfile is compiled as a binary property list, meaning it will look like gibberish if opened in a standard text editor. To read it as standard XML, copy the file to your Desktop, open Terminal, and run the command:plutil -convert xml1 ~/Desktop/Bookmarks.plist.