Safari History.db on iOS: Browsing History Forensics
iOS Safari browsing history in History.db: history_items and history_visits, backup and extraction paths, Cocoa timestamps, iCloud-synced visits and tabs.
- Location
- /private/var/mobile/Library/Safari/History.db (backup: HomeDomain, Library/Safari/History.db, fileID 1a0e7afc19d307da602ccdcece51af33afe92c53)
- Evidence area
- Proves
- Which URLs were visited in Safari (outside Private Browsing), with page titles, visit times, visit counts and redirect chains, including visits synced from the owner's other devices
- Timestamps
- Cocoa time in seconds (add 978307200 for Unix time), UTC, in history_visits.visit_time
- Acquisition
- Encrypted backup (Apple lists website history among data only encrypted backups include) or full file system extraction; open tabs need a full file system
- Retention
- Not user-configurable on iOS; entries leave when the user clears history or iOS prunes old visits. Measure the oldest visit_time on the evidence
- Collection
- idevicebackup2 (encrypted), iMazing, Full file system extraction
Tools
Compare all toolsWhat it is
History.db is the SQLite database in which Safari on iOS records browsing history. It uses the same schema as Safari on macOS: a table of unique URLs (history_items) and a table of individual visits (history_visits) that point back to them. Each visit keeps the page title as it was at the time, whether the load succeeded and, through redirect columns, the chain that led to the final page.
Private Browsing tabs do not write to History.db. Third-party browsers (Chrome, Firefox, Edge, DuckDuckGo) keep their own databases inside their app containers and are out of scope for this page.
Where it lives
| Source | Path | Notes |
|---|---|---|
| Full file system | /private/var/mobile/Library/Safari/History.db (+ -wal, -shm) | Main history database |
| iTunes / Finder backup | HomeDomain, Library/Safari/History.db | 1a/1a0e7afc19d307da602ccdcece51af33afe92c53 |
| Full file system | Safari data container, Library/Safari/ (BrowserState.db, and SafariTabs.db on iOS 15+) | Open tabs, tab groups and recently closed tabs; locate the container through the app's bundle ID |
Apple's documentation lists website history among the categories only encrypted backups contain. An unencrypted backup may therefore lack History.db: check Manifest.db before concluding the user never browsed.
What it proves
- The URLs visited in Safari and when, with the title the page had at the time.
- How often each URL was visited (
visit_count) and whether the last load succeeded. - Redirects: a click on a shortened or tracking link followed by the landing page.
- Visits that came from the owner's other devices through iCloud, distinguishable from local visits (see
origin).
It does not prove the user read or interacted with a page, and it says nothing about Private Browsing. A visit can also be triggered by a link opened from another app (Messages, Mail, a QR code scan).
Key fields
| Table / column | Meaning |
|---|---|
history_items.id | URL record identifier |
history_items.url | Full URL |
history_items.domain_expansion | Short domain label used by the UI |
history_items.visit_count | Number of visits to this URL |
history_visits.history_item | Foreign key to history_items.id |
history_visits.visit_time | Visit time (Cocoa seconds) |
history_visits.title | Page title at visit time |
history_visits.load_successful | 1 = page loaded |
history_visits.redirect_source, redirect_destination | Visit IDs forming a redirect chain |
history_visits.origin | 0 = visit made on this device, 1 = synced from another device (as commonly reported; validate) |
history_tombstones | Records of deleted history kept for iCloud sync |
Timestamps
visit_time is Cocoa time in seconds, often with a fractional part, in UTC.
SELECT v.id,
datetime(v.visit_time + 978307200, 'unixepoch') AS visit_utc,
i.url, v.title, i.visit_count, v.load_successful, v.origin,
v.redirect_source, v.redirect_destination
FROM history_visits v
JOIN history_items i ON v.history_item = i.id
ORDER BY v.visit_time;
Retention
iOS offers no history retention setting. Visits leave the database when the user clears history (all, or for a time range) or removes a site, and iOS prunes older entries on its own schedule. history_tombstones can keep evidence that something was deleted and when, even when the visit itself is gone. Measure the oldest visit_time and state it as the observed window.
Collection
- Encrypted backup with a password you set and record, then resolve
History.dbthrough Manifest.db. - Full file system for
History.dbwith its WAL, plus the Safari container for open tabs. Collect-waland-shmfiles with the database. - Hash the extracted files before parsing.
Parsing
- Browser Forensics parses
History.dbin the browser. It recognises the database by itshistory_itemsandhistory_visitstables, so a file that still carries its hashed backup name works too. - iLEAPP reports Safari history, tabs and related artifacts.
sqlite3or DB Browser for SQLite with the query above.
Investigator tips
- Filter on
originbefore attributing a visit to the iPhone. Synced visits from a Mac or iPad land in the same table. - Follow
redirect_sourceandredirect_destinationto explain how the user reached a page, for example from a phishing link in sms.db. - Cross-check visit times with app focus in KnowledgeC and Biome: Safari should be in the foreground, or a web view in another app was used.
- Downloads saved to Files or Photos appear elsewhere. For images saved from Safari, check Photos.sqlite for the importing app.
- An empty
History.dbnext to a populatedhistory_tombstonestable is a sign of clearing, not of inactivity.