Backup & Restore Saved macOS Passwords
In this article
Yes, you can back up and restore your saved macOS passwords (the ones stored in Keychain Access, including Wi-Fi, websites, and app passwords) by exporting the Keychain files and re-importing them later. This works for the login keychain and other keychains you have. Before you start, make sure you know your macOS user account password and, if you use iCloud Keychain, your iCloud security code or device passcode. The process is built into macOS, so no extra software is needed.
What You'll Need
- Your macOS user account password (required to unlock keychains and export them).
- If you use iCloud Keychain, your iCloud security code or a trusted device that can approve the restore.
- An external drive or secure folder to store the backup files (do not store them on the same disk you might erase).
Step-by-Step
These steps work on macOS Ventura and later, but the menu names may differ slightly by version. If you’re on an older macOS, the options are similar.
Backing Up Your Passwords
- Open Keychain Access. You can find it in Applications > Utilities or by pressing Cmd+Space and typing “Keychain Access”.
- In the top-left corner, you’ll see a list of keychains under “Keychains”. The default one is called login. Right-click (or Ctrl-click) on the keychain you want to back up (usually “login”).
- Choose Export Items from the context menu. If you want to export the entire keychain, select all items inside it first (press Cmd+A after clicking the keychain name).
- Choose a location for the exported file. It will be saved as a .p12 file (if you select “Personal Information Exchange (.p12)” format) or as a .keychain file (if you choose “Keychain” format). The .p12 format is more portable and can be imported later.
- You’ll be asked to set a password for the export. This password protects the file. Make it strong and store it somewhere safe—you’ll need it to restore.
- After entering the password, macOS will ask for your user account password to allow the export. Enter it and click OK.
- Repeat for any other keychains you want to back up (e.g., “System” if you have custom certificates).
- Copy the exported file(s) to your external drive or secure cloud storage. Do not leave them on your desktop.
Restoring Your Passwords
- Open Keychain Access again.
- If you’re restoring to a fresh macOS install, first create a new login keychain: go to Keychain Access > Preferences (Cmd+,), then click the Reset My Default Keychains button. This creates a new empty login keychain. (This step is optional if you already have a login keychain you want to replace.)
- In Keychain Access, go to File > Import Items (or right-click in the keychain list and choose Import).
- Navigate to your exported .p12 or .keychain file and select it.
- You’ll be asked which keychain to import into. Choose login (or the keychain you want).
- Enter the password you set during export when prompted.
- After importing, you may need to unlock the keychain: right-click the login keychain and select Unlock. Enter your user password.
- Your saved passwords should now appear in the list. Test by logging into a website you know was in the backup.
Common Mistakes
- Forgetting the export password – Without it, you cannot import the file. Store it in a password manager.
- Exporting only one item instead of all – If you don’t select all items, you’ll miss many passwords. Use Cmd+A after clicking the keychain name.
- Storing the backup on the same disk – If your Mac’s drive fails, you lose both the original and the backup. Use an external drive or a different cloud service.
- Importing into the wrong keychain – Make sure you select the login keychain, not a custom one, or the passwords won’t be used by default.
- Not unlocking the keychain after import – The keychain may appear locked; unlock it to access the passwords.
Tips
- Use iCloud Keychain as a live backup – If you enable iCloud Keychain (System Settings > Apple ID > iCloud > Passwords & Keychain), your passwords sync across devices and are recoverable after a reinstall by signing into iCloud.
- Export to .p12 format – This format is more standard and can be imported into other keychains or even other Macs. The .keychain format is native but less portable.
- Keep a printed list of critical passwords – For your most important accounts (email, bank), write them down and store them in a safe place, separate from your Mac.
- Test the backup – After exporting, try importing the file into a dummy keychain to verify it works before you rely on it.
- Update the backup regularly – Whenever you add many new passwords, re-export the keychain.
Troubleshooting
Import fails with “invalid password” – Double-check the export password you set. If you forgot it, there is no way to recover it; you’ll need to re-export from the original Mac if possible.
Passwords don’t appear after import – Make sure you imported into the login keychain. Also, check that the keychain is unlocked (right-click > Unlock). If you imported into a custom keychain, move the items: select them, then drag to the login keychain.
Keychain Access says “The keychain is locked” – Enter your macOS user password to unlock it. If it still won’t unlock, try resetting the keychain (but note this clears all current passwords).
You don’t see the Export option – Some keychains (like System) may not allow export. Only the login keychain and custom keychains can be exported. For System, you may need to use the security command in Terminal, but that’s advanced.
Restoring after a fresh macOS install – If you didn’t back up the keychain file, you can’t recover passwords. Use iCloud Keychain if you had it enabled. Otherwise, you’ll need to re-enter passwords manually.
Frequently Asked Questions
Can I back up only my Wi-Fi passwords?
Yes, you can select just the Wi-Fi entries in Keychain Access (they are labeled “AirPort” or “Wi-Fi” under “Kind”). Export them the same way, but only those items will be saved.
Will the backup work on a different Mac?
Yes, the .p12 file can be imported into any Mac’s Keychain Access. You’ll need the export password and your user password on the new Mac.
Does this back up my iCloud Keychain passwords?
No, exporting the login keychain only backs up what’s stored locally. iCloud Keychain passwords are synced separately and can be restored by signing into iCloud on the new Mac.
Is it safe to store the exported file in iCloud Drive?
Yes, but it’s not encrypted beyond the password you set. If you use iCloud Drive, enable Advanced Data Protection for extra security, or store it in an encrypted folder.
What if I forget the export password?
There is no way to recover it. You’ll need to export again from the original Mac, or manually re-enter the passwords.
Can I restore passwords without Keychain Access?
No, Keychain Access is the built-in tool. However, if you use a third-party password manager, you can export from there separately.