What recovery codes are
When you turn on two-factor authentication (2FA), signing in needs your password plus a second factor: a code from an authenticator app, a security key, or a prompt on your phone. That second factor is what stops someone who has stolen your password.
The second factor lives on a device, and devices get lost, stolen, broken and replaced. Recovery codes, also called backup codes, are the way back in when that happens. Most services give you between 8 and 16 of them when you enable 2FA. Each code works once, in place of the second factor.
That makes recovery codes as powerful as your phone for that account. Anyone holding your password and one unused code can sign in. They need to be stored where you can always reach them and nobody else can.
The mistakes that lock people out
- Not saving them at all. The screen says "save these codes", the user clicks Continue, and the codes are gone. Account recovery without them can take weeks, require identity documents, or fail outright.
- Saving them only on the phone they protect. A screenshot in the photo gallery disappears with the phone, which is exactly when you need it.
- Saving them in the account they unlock. Recovery codes for your email, stored in a draft email, cannot be opened when you are locked out of that email.
- Saving them in plain text in cloud storage. A file called
backup-codes.txtin a synced folder is readable by anyone who gets into that cloud account. - Using the last code and not generating more. Each code works once. When you use one, check how many remain.
A storage plan that works
The goal is two copies, kept independently, so no single loss takes both.
Copy 1: encrypted, on a device you carry
Store the codes in a password manager or encrypted vault, in the same entry as the account they belong to or as a separate note named clearly, for example "Email: 2FA recovery codes, generated March 2026". Make sure that vault is not protected by the same 2FA it holds codes for, or you have built a locked box with the key inside.
Copy 2: on paper, at home
Print the codes or write them out by hand, label them with the service and the date, and keep them with your other important documents: in a folder in a drawer, a fire-resistant box, or with your passport. Paper does not get hacked, does not need a battery and survives a phone upgrade. Some people keep a second sealed envelope with a trusted relative.
For your most important accounts
Your primary email and your password manager deserve extra care, because they unlock everything else. For those, also consider registering two hardware security keys, keeping one on your keyring and one at home. Most major services allow several second factors, and a spare key avoids using recovery codes at all.
Checklist when you enable 2FA
- Download or copy the recovery codes the moment they appear.
- Save them in your password manager or vault, labelled with the service and date.
- Print or write a paper copy and file it at home.
- If the service allows it, add a second factor as a backup: another security key, or an authenticator on a second device.
- Sign out and sign in again with the second factor to confirm it works before you rely on it.
When you replace your phone
A new phone is the most common time to get locked out. Before you wipe or trade in the old one:
- Move your authenticator app's accounts to the new phone, using the app's transfer feature, and check that the codes on the new phone are accepted.
- Sign in to your most important accounts on the new phone while the old one still works.
- Only then wipe the old device.
If something goes wrong anyway, a recovery code gets you in, and from there you can set up 2FA again on the new phone. Remember to generate fresh codes afterwards; many services invalidate the old set when you do.
If your codes may have been exposed
If you find your codes somewhere they should not be, such as an old unencrypted file or a shared folder, treat it like a leaked password. Sign in, generate a new set of recovery codes (this cancels the old ones on almost every service), store the new set properly, and delete the exposed copy. Check the account's recent sign-in activity while you are there.
How Operator Vault fits in
Operator Vault includes a recovery codes template in its document editor, so you can store a set of codes as an encrypted document next to the login it belongs to, with an optional PIN as a second lock. Because the vault works offline and needs no account, it does not depend on any of the 2FA-protected services it holds codes for. Keep your paper copy as well: no single place should be your only way back in.