Skip to content

Restore Firefox Saved Passwords After Reinstall

A reinstall gave you a clean Firefox profile, and the logins that were there last week are gone from the list. They are often still recoverable: either Firefox Sync holds an encrypted copy, or the old profile folder still sits on your disk.

Work through both checks before touching any files, and copy logins.json and key4.db only after you have backed up the profile Firefox is using now.

In this guide, I have covered:

Your saved logins may still be waiting in Firefox Sync

Reinstalling Firefox usually creates a fresh profile, even when the app was already on your computer. The new profile can look empty while your old logins sit untouched in the previous profile folder, or in Sync.

If the same Mozilla account was connected before the reinstall, Sync can bring saved passwords back. Mozilla encrypts that data on its servers. Never turned it on? Then there is no cloud copy to pull down.

  1. Open Firefox and select the account button in the toolbar.
  2. Choose Sync and save data or Turn on sync if the account is not connected.
  3. Sign in with the same Mozilla account you used before the reinstall.
  4. Wait for Sync to finish checking and restoring the account data.

You’ll know it worked when your sites and usernames reappear on the saved logins page. Mozilla’s Firefox Sync service page explains what the service stores and how it is protected.

Check the saved logins page before changing anything

Before you touch a single profile file, confirm the passwords are actually gone. Sometimes they are still listed, hidden behind an active search filter, or Firefox is running a profile you did not expect.

  1. Open the Firefox menu.
  2. Select Passwords.
  3. Review the list for a missing site and clear any active search filter.
  4. Check the username shown for that site to confirm it matches the account you expected.

If the entries are there and you only need to tidy them up, Add, Edit, and Manage Firefox Saved Passwords on a Computer walks through viewing, editing, and removing them.

Find out whether the old Firefox profile still exists

Is the old profile still on disk? Firefox keeps bookmarks, history, extensions, and saved passwords inside profiles, and a reinstall can leave the old one behind while starting you in a brand-new one.

Do not reinstall Firefox again at this point. Another installation will not bring back a profile that has already been deleted, and it only moves you further from the files you need.

  1. Open about:profiles in the Firefox address bar.
  2. Select Open Directory beside the profile that Firefox is currently using.
  3. Look in that folder for logins.json and key4.db.
  4. Return to about:profiles and look for another profile entry, or an old profile folder, that might contain the same files.

Those files are a matched pair. logins.json holds the encrypted login records, and key4.db carries the key material tied to your primary password.

Copy one without the other and the entries may stay unreadable.

Restore the password files from the old profile

If the old profile is still there, copy its password data into the profile Firefox is using now. Back up the current profile first, so you have something to return to if the swap goes wrong.

  1. Close every Firefox window and confirm that Firefox has fully exited.
  2. Open about:profiles in a new Firefox session and select Open Directory beside the current profile.
  3. Make a separate copy of the current profile folder as a backup.
  4. Open the old profile folder and locate logins.json and key4.db.
  5. Copy logins.json and key4.db into the current profile folder.
  6. Replace the existing files in the current folder only when Windows, macOS, or Linux asks you to confirm the replacement.
  7. Start Firefox and open the saved logins page.
  8. Confirm that the previous sites, usernames, and passwords appear.

Older installs may not use these file names at all. A profile created by Firefox 57 or earlier can hold signons.sqlite and key3.db. Do not drop those into a current profile without following Mozilla’s profile restoration guidance for an older profile.

note icon

Keep the original files untouched. Work on a copy of the old profile, and make sure Firefox is closed before replacing logins.json or key4.db. This also protects your only remaining copy if the current profile is damaged.

Use the old profile directly if the copied logins will not decrypt

Firefox asks for a different primary password, or the entries show up but refuse to open? The copied files probably belong to a profile with a different encryption setup.

Restoring the complete old profile is safer than combining single files from two profiles.

  1. Open about:profiles in Firefox.
  2. Select Open Folder for the old profile and confirm that it contains the expected login files.
  3. Select Open in New Window beside the old profile.
  4. Check the saved logins page in that window.
  5. If the logins open correctly, keep using that profile, or move the relevant profile data into a fresh profile as a separate backup.

If the old profile is marked as unavailable, it may have been deleted, moved, or damaged. When that happens, Firefox Sync is the remaining supported route, provided a synced copy existed.

What to do when the old profile is gone

No old profile folder anywhere? Then there is no local Firefox password file left to restore.

Reinstalling the browser again will not recreate deleted logins. Clearing site data is not the same thing as removing a profile, either.

Sign in to the same Mozilla account and let Sync finish. If nothing appears, open Firefox on another device that used that account, since the logins may still be stored there.

If Sync was never switched on, look for a password export you made before the reinstall. Then check a password manager, or a password file saved outside Firefox.

Mozilla’s support discussion about recovering Firefox data also outlines the profile and Sync checks for this situation.

Frequently Asked Questions

Will reinstalling Firefox delete my saved passwords?

Reinstalling can create a new profile that does not show the logins from your previous one. If the old profile is still on disk, its password files may still be recoverable.

Can I restore Firefox passwords with only a CSV file?

Depends on what the CSV holds. Firefox can export saved logins, but a plain CSV usually does not carry the encryption data needed to rebuild the whole password database.

Why do my restored Firefox logins ask for the wrong primary password?

The copied logins.json and key4.db may not match each other, or they may come from a profile protected by a different primary password. Use the matching files from the same old profile instead of mixing two.

Can I recover Firefox passwords after clearing browser data?

Clearing ordinary browsing data does not necessarily remove a profile’s saved logins. If the saved logins page is empty, check which profile Firefox has selected at about:profiles before attempting a file-level restore.

How do I verify that the recovery worked?

Open the saved logins page and look for a familiar site, username, and password. Then confirm at about:profiles that the active profile is the one holding the recovered files.

Please share the article if you find it helpful:

Disclosure: This page may contain affiliate links, which means we may receive compensation for your purchases; of course at no extra cost to you (indeed, you may get special discounts).
Jack Mitchell

Jack Mitchell

Jack Mitchell is a software engineering graduate. He moved to Firefox for container tabs and privacy controls, so most Chrome extensions are gone. He surfs when the swell is good and keeps chillies alive on the balcony.

Leave a thought or feedback

Please leave a descriptive comment or feedback with your real name. Our human moderator vets every comment, and it may take 24 to 48 hours to get published or rejected.
Your email address will not be published, and we will never spam your inbox. Required fields are marked *