How can I export chrome passwords?

73,192

Solution 1

There are several solutions listed below, not all of them might work with the latest versions of Chrome. The 'official' Google Chrome/Canary solution is the only one which is currently reliable. Other, potentially outdated solutions include a JS-based one for any OS, an OSX-only solution, and a Linux-only solution (confirmed to work in Chrome 68).

Official Chrome Import/Export buttons

  1. Required: Install latest Google Chrome (if latest stable google chrome does not work for you then try with the Chrome Canary).
  2. Log in with your google account, set up synching, and wait some minutes until all passwords are synched.
  3. Open Chrome Flags by typing chrome://flags in the address bar.
  4. Locate and enable the options Password import and Password export, and restart Chrome Canary.
  5. Now open chrome://settings/passwords where you should see a three dot icon. Clicking it will show the IMPORT and EXPORT options:

Chrome password import-export

Update: in more recent Canary versions instead of the Import/Export buttons there is a single three dot button that contains an Export option.

Javascript-based solution

Note: As of chrome v60+ the method described below does not work anymore.

An OS-independent way to extract the Chrome passwords to a human/spreadsheet readable format is via the Chrome Javascript API, as described on this page:

  1. Open chrome://settings-frame/passwords in your browser (also accessible from Chrome Settings > Show Advanced Settings... > Chrome Passwords).
  2. Open DevTools by right-clicking on the page > Inspect (or Ctr+Shift+I or ⌘+⌥+I).
  3. Click the Console tab.
  4. Click the dropdown that reads top (or <top frame>) and select the password frame: settings (password), as shown in the screeenshot (WARNING: Skipping this step will result in the error PasswordManager is not defined): Chrome Dev Tools Console tab
  5. Next, paste the following code in the Console pane and press Enter (based on code from https://github.com/megmage/chrome-export-passwords which was cleaned up and made to work on Chrome v50+):
var out = [];
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
console.log(model);
var pl = pm.savedPasswordsList_;
for (var i = 0; i < model.length; i++) {
    PasswordManager.requestShowPassword(i);
}
alert('After you press Ok results should appear in ~5 seconds.\n' +
    "If password fields are empty, try increasing the timeout in the last line," +
    " i.e. set to 10000 for 10 seconds");
setTimeout(
    function () {
        out.push('# Generated by Password Exporter; Export format 1.1; Encrypted: false');
        out.push('"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"');
        for (var i = 0; i < model.length; i++) {
            var record = model.array_[i];
            var user = record.username;
            var item = pl.getListItemByIndex(i);
            var pass = item.querySelector('div.password input').value;
            var proto = record.url.split('://')[0];
            var line = `"${proto}://${record.shownOrigin}", "${user}", "${pass}", "${record.url}", ," "," "," "`;
            out.push(line);
            console.log(line);
        }
        document.body.innerText = out.join('\n');
    }, 5000);

IMPORTANT: This code is for versions of Chrome starting with v50. For earlier versions use the code linked in the original github page.

The passwords should appear on the same page in CSV format. Select and copy the output to a text file with .CSV extension — it can be opened in Excel/Libreoffice Calc. The format is compatible with Firefox Password Exporter, and can be used to import the passwords into Firefox.

Note to OSX users

Recent versions of Google Chrome/Chromium for OSX store passwords in the system keychain, which means that Chrome uses the OSX built-in credential storage mechanism (this is already outdated info).

On OSX you can export the passwords by running this in the terminal:

sudo security dump-keychain -d login.keychain > keychain.txt

And yes, you'll need to click Allow All as many times as you have domains in your login keychain, unless you use an autoclicker script. The link also points to a ruby script for converting the generated password file to CSV. The Ruby script worked for me after I removed the line containing proto.gsub!('htps', 'https');.

Alternatively you can use the native OSX app Keychain Access (type the name in Spotlight).

NOTE: As indicated by oarfish, Chrome stopped using the OSX Keychain as of v.45.

Linux-only solution to export passwords

This solution still works in current versions of chrome (v68)

The recipe below is a Linux-only solution and was taken from this blog post I created a while ago. To export your passwords to a CSV spreadsheet that can be opened in LibreOffice or Excel:

  1. If not already synced in Chrome, then connect to your Google Account in Chrome Settings so that your passwords are synced with the Google cloud storage. Make sure that you have ticked Passwords in Advanced Sync Settings.
  2. Wait for a while until the data is synched, and then close all the Chrome windows.
  3. Start Chrome/Chromium using one of the command line below. This will launch Chrome with a custom profile folder without affecting your current chrome profile.

    ## for Chrome:
    google-chrome --user-data-dir=/tmp/chrome-tmp --password-store=basic
    
    ## for Chromium:
    chromium --user-data-dir=/tmp/chrome-tmp --password-store=basic
    
  4. Setup Google Synching for the new temporary profile and wait until everything is synced from the cloud, i.e. your bookmarks appear, extensions show up, the theme is applied, etc. Verify that the passwords are restored from the Google cloud by looking under Settings → Personal Stuff → Manage Saved Passwords. If they do not appear, then wait a couple of minutes more. Note: To access the stored passwords page open settings and password in the Search box in the top right, the the Manage passwords will appear at the bottom of the page. You can also use the direct link chrome://settings/passwords.

  5. Exit Chrome.

  6. Next, open a terminal and cd to the newly created Chrome profile:

    cd /tmp/chrome-tmp/Default
    
  7. Now, open the Login Data database file using the sqlite3 command line utility and dump the logins table. For this to work, you need to have sqlite3 installed on your system (in most Linuces comes pre-installed or is available in the repos).

    sqlite3 'Login Data'
    
  8. Next, at the SQLite prompt enter the commands below. For help on available commands type .help at the prompt.

    .mode csv               # other options are `html', `tabs', etc.
    .headers on
    .separator ","
    .output chrome_passwords.csv
    select * from logins;
    .exit
    

Now you should have a file named chrome_passwords.csv containing all your Chrome passwords. To open it with LibreOffice, type:

    libreoffice --calc chrome_passwords.csv

The Login Data file can be opened directly with a SQLite GUI app, such sqlitebrowser, sqliteman or sqlitestudio, of which the first two are normally available in Linux repos.

Solution 2

ChromePass looks like the tool you want. There are options to save out to HTML and plaintext, both of which are very easy to print.

Solution 3

Found the easiest solution here: https://www.axllent.org/docs/view/export-chrome-passwords/

As of July/August 2016 Google introduced a hidden feature that allows you to import & export your passwords. All you currently need to do is turn on the hidden feature in the chrome://flags settings and restart your browser, after which you'll have the required functionality.

Instructions

  • In your Google Chrome (or Chromium, whichever you use), type the following in your URL bar: chrome://flags/#password-import-export, and then enable the feature.
  • Restart your browser.
  • Go to your passwords chrome://settings/passwords (you may have to wait a little while for your passwords to sync), then scroll down to below your passwords and you'll see two new buttons, Import & Export.
  • Click Export, making sure you select the correct format (CSV).

Solution 4

The other password export methods are fairly involved; for this reason, I wrote a simple javascript snippet to take care of the job.

simple script to export chrome passwords, run when the password manager is open from the chrome console (hit f12 to access the console) in frame settings( passwords )

out="";out2="";dat=document.getElementsByClassName("password");

for(i=0;i<dat.length;i++){x=dat[i].parentNode;

out+="\n"+x.childNodes[0].innerText+"|"+x.childNodes[1].innerText+"|"+x.childNodes[2].childNodes[0].value;

out2+="br/>"+x.childNodes[0].innerText+"|"+x.childNodes[1].innerText+"|"+x.childNodes[2].childNodes[0].value;};console.log(out);

document.write(out2)

Solution 5

As at the end of ccpizza's answer,

  1. Go to chrome://settings/passwords.
  2. Click the three dots to the far right of Saved Passwords.
  3. Click the Export menu item that appears.

It seems the Chrome Canary functionality that ccpizza mentions is now live on normal Chrome. (I'm currently at Version 72, on Windows.)

Share:
73,192
Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    I want to be able to export passwords from Chrome browser so that I can make a printed copy.

  • TariqoO
    TariqoO about 10 years
    Doesn't work for me on OS X with Chrome 34. I get empty passwords in the resulting file.
  • ccpizza
    ccpizza about 10 years
    @m_gol: On OSX Chrome stores passwords in the keychain, and the --password-store=... arg has no effect. Login Data is still used but only for the metadata that does not fit into the keychain. So, if you want to see your passwords, type Keychain Access in spotlight. To migrate your passwords to another OSX system you'll need to copy both ~/Library/Keychains/login.keychain and your chrome profile ~/Library/Application Support/Google/Chrome/<__YOUR_PROFILE_FOLDER__>. If you only have a single chrome profile then the profile folder will be called Default.
  • edleciel
    edleciel almost 10 years
    Chrome gives a warning when trying to download the *.exe. Is this download okay?
  • Ed Orsi
    Ed Orsi almost 10 years
    This does NOT work as of Chrome 37. Looks like any sort of dom element getting api returns null on that page :(
  • confiq
    confiq over 9 years
    this does not work on version 38+
  • Vladimir Shmidt
    Vladimir Shmidt over 9 years
    Sorry it doesn't work in windows version
  • ccpizza
    ccpizza over 9 years
    @VladimirShmidt: If you are on OSX type Keychain Access in the spotlight search - it is built-in OSX app.
  • Jedidja
    Jedidja about 9 years
    It seems solid. I tried it and although Windows Defender thought it was malware, I haven't seen any changes made to my system.
  • Stijn de Witt
    Stijn de Witt about 9 years
    @EdOrsi You need to select the right frame (as alog already mentions in his answer)
  • Stijn de Witt
    Stijn de Witt about 9 years
    @alog Thank you very much this answer really helped me!
  • Fery W
    Fery W almost 9 years
    You've save my day @ccpizza. It works in Freya 0.3.1 :* (nohomo)
  • ccpizza
    ccpizza over 8 years
    @confiq: the steps do work in version 47 on Ubuntu, and I would assume that it works in earlier versions too.
  • Filip Haglund
    Filip Haglund over 8 years
    "I haven't seen any changes made to my system." that doesn't mean anything! Most programs (all?) do changes you don't notice, and many do things you never notice.
  • ccpizza
    ccpizza about 8 years
    this doesn't work in latest chrome versions, e.g. 51.0.2704.84 — only login names are listed.
  • oarfish
    oarfish almost 8 years
    Note: As of 45, Chrome does not use the Keychain anymore. bugs.chromium.org/p/chromium/issues/detail?id=466638
  • Kris
    Kris about 7 years
    So simple.. I'm surprised this isn't the most popular answer.
  • CopyJosh
    CopyJosh almost 7 years
    Even with the flag, I don't see an import / export button as described. This might have been removed altogether now that passwords are accessible at passwords.google.com .. though that page doesn't have the options either.
  • Emilien
    Emilien almost 7 years
    Currently running Chromium 59.0.3071.109 on Ubuntu 16.04, I still have the option available.
  • Bas van Ommen
    Bas van Ommen over 6 years
    Just exported everything using this post productforums.google.com/d/msg/chrome/99KZmH2DRrA/5l37AibyAw‌​AJ Worked like a charm, only there is no export button: find the three vertical dots next to the 'Saved Password' heading, then you will find 'export' @ccpizza: perhaps update the answer?
  • ryanpcmcquen
    ryanpcmcquen over 6 years
    @ccpizza, there is a new JS solution that works with Chrome 63+: gist.github.com/ryanpcmcquen/cee082bff514f8849a29c409fe3571f‌​f
  • SamAndrew81
    SamAndrew81 over 5 years
    This no longer works as of the latest version of Chrome (Feb '19).
  • Mathieu K.
    Mathieu K. over 5 years
    On Windows, it appears the Canary functionality is now live on the main builds. I don't believe any chrome://flags are required for this. Update your answer (I'd have done it, but it'd be a pretty big change, and I haven't tested Linux and don't own a Mac) and I'll delete mine.
  • Emilien
    Emilien over 5 years
    Running Chromium version 73.0.3683.75 on Ubuntu 16.04 (64 bits), I confirm that the #password-import-export feature is not there any longer, there seems to only be an Import feature left: chrome://flags/#PasswordImport (which is not what we want here). This page productforums.google.com/forum/#!topic/chrome/99KZmH2DRrA confirms the option disapeared, but indicates "In chrome://settings/passwords, click the 3-dot menu icon to choose Import and Export." (I don't seem to have a 3-dot menu icon though... But maybe because I don't have any passwords saved in Chromium anymore?) FWIW...
  • YasserKhalil
    YasserKhalil about 2 years
    @alog Thanks a lot. Where's the output exactly?