Skip to content

Web browsingUser activity

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

What 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

SourcePathNotes
Full file system/private/var/mobile/Library/Safari/History.db (+ -wal, -shm)Main history database
iTunes / Finder backupHomeDomain, Library/Safari/History.db1a/1a0e7afc19d307da602ccdcece51af33afe92c53
Full file systemSafari 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 / columnMeaning
history_items.idURL record identifier
history_items.urlFull URL
history_items.domain_expansionShort domain label used by the UI
history_items.visit_countNumber of visits to this URL
history_visits.history_itemForeign key to history_items.id
history_visits.visit_timeVisit time (Cocoa seconds)
history_visits.titlePage title at visit time
history_visits.load_successful1 = page loaded
history_visits.redirect_source, redirect_destinationVisit IDs forming a redirect chain
history_visits.origin0 = visit made on this device, 1 = synced from another device (as commonly reported; validate)
history_tombstonesRecords 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.db through Manifest.db.
  • Full file system for History.db with its WAL, plus the Safari container for open tabs. Collect -wal and -shm files with the database.
  • Hash the extracted files before parsing.

Parsing

  • Browser Forensics parses History.db in the browser. It recognises the database by its history_items and history_visits tables, so a file that still carries its hashed backup name works too.
  • iLEAPP reports Safari history, tabs and related artifacts.
  • sqlite3 or DB Browser for SQLite with the query above.

Investigator tips

  • Filter on origin before attributing a visit to the iPhone. Synced visits from a Mac or iPad land in the same table.
  • Follow redirect_source and redirect_destination to 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.db next to a populated history_tombstones table is a sign of clearing, not of inactivity.

See also