Export Chrome History as CSV (Spreadsheet)

Life

Chrome stores history as an SQLITE3 database.

First, find it.
Close Chrome.

Open up the terminal, and navigate to the directory that contains the History file.

1
cd ~/Library/Application\ Support/Google/Chrome/Default/

Open the database with SQLITE3:

1
sqlite3 History

Enable Sqlite3 output mode as CSV by typing into sqlite shell:

1
2
3
sqlite> .headers on
sqlite> .mode csv
sqlite> .output my-chrome-output.csv

Now, execute the SQL statement (copy and paste). Note that by default, the time stamp is not “human readable” so we’ll insert some logic to convert times into our local time zone / months, years, and that good stuff.

1
2
3
4
SELECT datetime(last_visit_time/1000000-11644473600,'unixepoch','localtime'),
                        url
                 FROM urls
                 ORDER BY last_visit_time DESC

Report this ad

Done! Check your directory for my-chrome-output.csv.

Why this isn’t documented anywhere except in small pieces? Don’t know.

Advertisements
Report this ad
Advertisements
Report this ad

11 thoughts on “Export Chrome History as CSV (Spreadsheet)

    1. This is awesome except for the LastTimeVisited.

      For Aug 24, 2014 @ 12:20:xx it lists a value of 1408900847799.88 how do I get this date time format from what ever it’s stored as to a date/time format that I can understand.

  1. Report this ad

Leave a Reply