Skip to content
OTP Generator

Guide

2FA Backup Codes: What They Are, How to Use and Store Them

Locked out without your authenticator? A 2FA backup code gets you back in. Learn what backup codes are, how to use one, where to keep them and what to avoid.

6 min readUpdated November 12, 2026Fact-checked against RFC 6238

Quick answer

Do 2FA backup codes expire?

Usually not on a timer. Each code stays valid until you use it once or generate a new set, which typically cancels the old list. A few services may expire codes after long inactivity or when you change security settings, so check the details for each important account.

More answers
On this page

What backup codes are

Backup codes, also called recovery codes or emergency codes, are a short list of one-time passwords a service gives you when you turn on two-factor authentication. They usually look like 4821-9937 or k7pm-2xqa-91tf, and you typically get between 8 and 16 of them.

Each code can stand in for your normal second factor exactly once. If your phone is lost, broken, or out of battery, you type your password, choose the option to use a backup code, and enter one from the list. That code is then crossed off by the service and will not work again.

Unlike authenticator codes, backup codes do not expire after 30 seconds. They stay valid until you use them or generate a new set. That makes them extremely useful, and it also means they need to be stored carefully.

Why they matter more than people think

Two-factor authentication is designed to make it hard to get into your account without your second factor. That includes you. Without backup codes, losing your phone can mean days of identity checks or, for some services, losing the account permanently.

Backup codes are the cheapest insurance in account security. Saving them takes a minute during setup; not having them can cost hours or more later. Our guide on recovering from a lost phone shows how much easier the process is when you have them.

Good places to store backup codes

The golden rule is to store backup codes somewhere you can reach without your phone, yet that a stranger cannot easily reach. A few solid options:

  • A password manager. Most let you attach notes to each login. Paste the codes into the note of the matching entry. This works well as long as your password manager itself is not protected only by the phone you might lose.
  • Printed on paper. Old-fashioned and very effective against online attacks. Keep the sheet at home in a drawer, file box, or safe, labelled clearly by service.
  • An encrypted file or drive. An encrypted archive or vault on a computer or USB drive, with a password you will remember.
  • A trusted second location. For truly critical accounts, a second printed copy in another secure place protects against fire or flood.

If you like to keep a neat paper record, our backup code generator can lay codes out as a printable sheet in your browser.

Places to avoid

  • Only on the same phone as your authenticator. If you lose the phone, you lose both at once, which defeats the purpose.
  • Plain-text notes synced everywhere. An unencrypted note in a cloud notes app or your email drafts is easy to forget and easy for an attacker to find if one of those accounts is compromised.
  • Screenshots in your photo library. Photos often sync to the cloud automatically and are browsed casually.
  • Shared documents. Never paste codes into team docs, chats, or support tickets.
  • Your desktop as backup-codes.txt. Malware specifically looks for files like this.

The common thread: avoid anywhere that is either tied to the device you might lose or casually readable by anyone who gets into one of your other accounts.

Using and refreshing your codes

A few habits keep backup codes useful over time:

  1. Cross off codes as you use them. When the list runs low, generate a new set from the account's security settings. Generating new codes almost always invalidates the old ones, so replace your stored copy right away.
  2. Regenerate after any scare. If you think someone may have seen your codes, create a fresh set immediately.
  3. Check them once a year. Confirm you can still find them and that they belong to accounts you still use.
  4. Label everything. A sheet of anonymous codes is useless if you cannot tell which service they belong to.

How to use a backup code when you need one

The moment you need a backup code is usually stressful, so it helps to know the flow in advance. It is similar on most services:

  1. Sign in with your username and password as normal.
  2. When asked for your authenticator code, look for a link such as "Try another way", "Use a backup code", "Lost your device?" or "More options".
  3. Select the backup or recovery code option and type one code exactly as written. Hyphens and spaces are usually optional.
  4. Once you are in, go straight to the security settings and fix the underlying problem: register your new device, remove the lost one, and check that your recovery email and phone are current.

A few services use a single long recovery key instead of a list of short codes. It works the same way but is often the only one you get, so store it with extra care. Some services also invalidate the recovery key after use and issue a new one, which you must save again.

Backup codes vs saving your secret key

Some people also keep a copy of the TOTP setup key itself, the Base32 string behind the QR code. That lets you rebuild your authenticator on any device, which is more flexible than backup codes but also more sensitive: anyone with the key can produce unlimited valid codes, not just a handful of one-time ones.

If you go this route, treat the key like a password and keep it in a password manager or encrypted storage. Our guide on finding your 2FA secret key explains where to get it. For most people, backup codes plus an authenticator with encrypted backup is a comfortable balance.

Frequently asked questions

Do 2FA backup codes expire?

Usually not on a timer. Each code stays valid until you use it once or generate a new set, which typically cancels the old list. A few services may expire codes after long inactivity or when you change security settings, so check the details for each important account.

Can I reuse a backup code?

No. Each backup code is single-use. After it is accepted, the service marks it as spent and will reject it next time. Cross it off your list, and generate a new set when you are down to the last few codes.

Is it safe to store backup codes in a password manager?

Generally yes, provided the password manager has a strong master password and its own protection. The main caution is circular dependency: if unlocking the password manager requires the very phone you lost, keep a printed copy of your most important codes as well.

What if I never saved my backup codes?

If you can still sign in, go to the account's security settings now and generate a new set; this usually works without the old list. If you are already locked out, you will need another registered factor or the service's official account recovery process.

Need a code right now?

Paste your key and get the current 6-digit code in seconds. Free, private and nothing to install.