You are locked out right now. The authenticator is gone, or the phone is gone, or the app opens and the numbers it shows are being refused. So you went and found the thing you saved for exactly this moment: a printed sheet, a text file, a screenshot, a line in a password manager. You typed it in carefully. The service said no.
That is a specific problem with a short list of causes, and almost none of them are the one the internet will tell you. The results for this question are either a single vendor's troubleshooting page, or a forum thread where the answer sits four hours down in the replies, or a storage guide explaining where you should have kept the codes, which is useless advice to somebody holding them. So this page does the one thing those pages do not: it works out what you are actually holding, then walks the causes in the order that resolves the most lockouts first.
One honest warning before the list. A refused backup code usually means the code is genuinely dead rather than mistyped, and dead codes do not come back. Work the list anyway, because three of the five causes are recoverable in under a minute, and the two that are not will at least stop you burning attempts on a code that can never work.
The short answer
- First decide which of three different things you are holding. A six-digit code from an app, a single-use backup code, and a recovery key are three separate artifacts, and typing one into the other one's box fails every time.
- Then work the causes in this order: the set was retired without telling you, the code has already been spent, the file belongs to a different account or an older enrolment, the format is being mangled, and the service is refusing the attempt rather than the code.
- The silent killer is regeneration. Viewing a fresh set, or switching two-factor authentication off and on again, invalidates the set you printed. Nothing emails you about it.
- The single best trap to know: some services issue one long code displayed in groups, and people read the groups as separate codes. Bitwarden's single recovery code is 32 characters shown in eight groups of four.
- If every code fails, stop guessing and change route. Each provider has an identity-based way back in, and our page on a lost authenticator with no backup codes covers what Google, Microsoft, Apple, Meta, Discord, GitHub and the exchanges each ask for.
Three different things get called a backup code
This is where most of the confusion on this query comes from, and it is worth thirty seconds before you type anything else. Look at what you are holding and match it to one of these three.
A code from the authenticator app. Six or eight digits, changes every thirty seconds, no letters. If this is what you are holding, you are in a different situation and the causes are different ones: a clock offset, a second enrolment, a narrow acceptance window. Our page on a 2FA code that is not working is the right one for that.
A single-use backup code. A short string from a list or sheet, which you were given when you turned the second factor on. Each one works once. GitHub calls them recovery codes and issues sixteen. Google calls them backup codes and issues ten of eight digits each. Microsoft issues exactly one, of twenty-five digits. Bitwarden issues exactly one, and it is the thing that switches two-step login off rather than a second factor you log in with.
A recovery key or passphrase. Longer, often with no hyphens, and usually tied to the password or to encrypted data rather than to the second factor. Apple's recovery key is "a 28-character code" that exists to help you regain access to the account, and Apple's own instructions say you use it together with "a verification code sent to your trusted phone number", which is the clearest possible proof that the key and the code are two different items. If you are typing a long recovery key into a box that wants a short two-factor code, it will be refused no matter how carefully you read it out.
A useful shape to notice: the sheet of single-use codes is for getting in. The recovery key is usually for resetting the password or decrypting data. The app code is the routine factor. Three jobs, three artifacts, and no service accepts them interchangeably.
Cause 1: the set was retired without telling you
This resolves more of these lockouts than any other single cause, and the reason it is so painful is that nothing announces it. The codes on your sheet were valid when you printed them. Something later made the server stop recognising the whole set, and the sheet looks exactly the same as it did before.
Three things do it.
Generating a new set. Every provider says this plainly once you go looking. GitHub: "Generating a new set of recovery codes will invalidate any codes you previously generated." Google: "When you create a new set of codes, the old set automatically becomes inactive." Microsoft: "As soon as you create a new recovery code, any previous codes will no longer work." If you ever opened the security page, saw the codes, and clicked the button that offered fresh ones, the printout in your hand died at that moment.
Switching two-factor authentication off and back on. GitHub's documentation is explicit that if you disable and re-enable 2FA, "the recovery codes in your security settings automatically update", which is the polite way of saying your old list is now scrap. This catches people who re-enrolled after changing phones.
Re-running setup, in some cases but not others. The same GitHub page draws a line worth knowing: reconfiguring two-factor authentication without disabling it first "will not change your recovery codes". So "I set up my new phone" is not automatically fatal to the old sheet. Whether it was depends on whether the old factor was removed in the process.
What to do with this: if you have any chance of a newer set existing, look for it before you keep typing. A newer download in the browser's downloads folder, a newer note in the password manager, a newer printout in a different drawer. The newest set is the only valid one.
Cause 2: that code has already been spent
Every provider that issues a list makes each entry single use. GitHub: "Each code is single-use only: once it has been used to authenticate, it cannot be used again." Google: "After you use a backup code to sign in, that code becomes inactive."
So a code can be perfectly genuine, correctly typed, from the current set, and still be refused because you or some past version of you already used it. This is why the practice of crossing a code off the sheet the moment you use it is not fussiness, it is the only record that exists on your side.
Two details that matter when you are in the middle of it:
- Work down the list, not from the top. If the first code fails, try the next, and the next. People routinely stop after one refusal and conclude the whole set is dead, when in fact they had used the first two a year ago.
- A failed attempt does not spend a code. If a code is rejected, it is either dead already or being mangled in transit. You are not burning the sheet by trying, so trying three or four is reasonable. What you can burn is your attempt budget, which is cause 5.
Bitwarden's single recovery code is a special case worth calling out: it is consumed when used, and its help page says that "After using a recovery code, a new one is generated. Make sure to save the updated code." So a code that once worked is a code that no longer works, and the replacement is sitting in an account you may not be able to reach.
Cause 3: the file you are reading belongs to something else
Backup codes carry no label. A downloaded file is often called something generic, the contents are a bare list of digits, and nothing in it names the account it belongs to. That makes two mistakes very easy.
Wrong account at the same provider. If you have a personal and a work account at the same service, or two accounts at one exchange, the sheets look identical and are not interchangeable. This is the same class of error as copying the right-looking code from the wrong entry in an authenticator, which is a cause our 2FA code not working page covers for app codes.
Wrong generation of the same account. An older downloaded file sitting beside a newer one, both named for the same service, is the most common version of this. Check file dates before you trust contents. The newest file wins, and if the newest file is the one you already tried, cause 1 is probably what happened.
Worth a moment of honesty here: this is also the one cause that is easy to prevent for next time, and the prevention is dull. Date the sheet, name the account on it, cross off what you spend, and keep one set per account rather than one folder of mystery digits. Our guide on where to store 2FA backup codes goes through the storage decision properly, including why a photo in a synced camera roll is the worst of the common choices.
Cause 4: format traps, including one long code that looks like eight
If the code is current and unspent, the next suspect is the shape of what you are typing.
One code at a time. The box wants a single code, not the list. This sounds too obvious to mention until you have seen somebody paste a whole file into it.
Separators are usually optional, but not always ignored. GitHub's recovery codes carry a hyphen by design: "A single code is 10 alphanumeric characters with a hyphen in the middle: xxxxx-yyyyy." Type it as shown first. If that is refused, try it without the separator, because many services strip punctuation and some do not.
Spaces inside one long code. On Bitwarden's community forum, the answer that solves this question for most people is the one explaining that the code "consists of 32 alphanumeric characters, which are presented in 8 groups of four", and that "you can enter the recovery code either with or without spaces". The follow-up reply puts it even more bluntly: "Bitwarden does not have 8 recovery codes. It has one recovery code that is broken into 8 space-separated parts."
That last one is worth dwelling on, because it is the single most misread artifact in this whole category. A narrow phone screen wraps those eight groups onto separate lines, and a reasonable person looks at eight lines of four characters and concludes they have been given eight codes. They then try each line as a code, all eight fail, and they conclude the backup codes are broken. Nothing is broken. The code is all eight groups joined together.
Case, and look-alike characters. Alphanumeric codes are usually case-insensitive, but the characters are where hand transcription dies: zero against capital O, one against lowercase l, five against S. If the code came off a photograph or a handwritten note rather than a file, retype it twice with those pairs swapped before you call it dead.
The box may be the wrong box. Several services do not accept a backup code in the normal two-factor prompt at all. On GitHub you have to click through, and the documented step is to choose 2FA recovery code under "More options". Bitwarden is stricter still, because its recovery code is used at a dedicated recovery page with your email address and master password, not at the login prompt. If the field you are staring at is labelled for a six-digit code, look for the link that offers the other kind.
Cause 5: the service is refusing the attempt, not the code
This one is invisible from the outside and it is why "I tried everything and now nothing works" is such a common end to these stories. After a run of failures, many services stop evaluating what you type and simply refuse.
The standard behind this is not a secret. NIST's digital identity guidelines require it: a verifier "SHALL limit consecutive failed authentication attempts using a specific authenticator" on one account "to no more than 100 by disabling that authenticator", and the same section allows throttling in the meantime, including a bot-detection challenge or a mandatory wait that grows with each failure, with an example range of thirty seconds up to an hour.
Real implementations are far tighter than the ceiling. Microsoft Entra's smart lockout, which governs work and school accounts, locks an account "after 10 failed attempts" by default, three in United States Government tenants, and the lockout period "is one minute at first, and longer in subsequent attempts". Microsoft deliberately does not publish how fast that escalates. The message you see is generic: "Your account is temporarily locked to prevent unauthorized use. Try again later, and if you still have trouble, contact your admin."
How to tell this is what is happening:
- The error wording changes between attempts, or becomes vaguer, or mentions trying again later.
- The same code fails instantly where earlier attempts took a moment.
- A correct password is suddenly rejected too, which means the lockout is on the account rather than the factor.
What to do: stop. Wait fifteen minutes without touching the page, then try exactly one code, chosen as your best candidate. Do not cycle the sheet during a throttle, because you learn nothing and you keep the window open. If you are on a work account, the administrator can clear it, which is the fastest route available to you.
Backup codes not working, recovery code not working: the same field, different words
The words are not standardised, and that is a real source of this problem rather than a pedantic note. The same artifact is called backup codes, recovery codes, one-time codes, two-step recovery codes or an emergency kit depending on who issued it, and the differences in count and format are much bigger than the differences in name.
| Service | What you were issued | Format | What makes it stop working |
|---|---|---|---|
| GitHub | 16 recovery codes | 10 alphanumeric characters as xxxxx-yyyyy | Using one, generating a new set, or disabling then re-enabling 2FA |
| 10 backup codes | 8 digits | Using one, or creating a new set | |
| Microsoft | 1 recovery code | 25 digits | Creating a new one, and it cannot be retrieved again |
| Bitwarden | 1 recovery code | 32 alphanumeric characters shown in 8 groups | Using it, which generates a replacement |
| Apple | A recovery key, which is not a 2FA code | 28 characters | Regenerating or turning it off |
Read that table as a diagnosis tool. If you are holding eight groups and the provider in the left column issues one code, you are not holding eight codes. If you are holding a list and the provider issues one, you are holding the wrong file. If you are holding twenty-five digits, nobody can reissue that to you later, because Microsoft states flatly that "You cannot retrieve or download an existing Microsoft account recovery code."
The order to work in
Here is the whole thing as a sequence, so you can stop reading and start resolving.
- Identify the artifact. App code, single-use code, or recovery key. If it is a recovery key, find the password-reset or account-recovery flow instead of the sign-in prompt.
- Find the newest copy. Downloads folder, password manager, printouts, email. Any newer set invalidates everything older.
- Try it in the right box, exactly as printed. Use the service's own "use a recovery code" route. One code, separators included.
- Try the next two codes, and one reformatting. Without separators, or with all groups joined if it is one long code.
- Stop at four failures. Wait fifteen minutes in case you are being throttled, then make one more attempt with your best candidate.
- Change route. If that fails, the set is dead and no amount of retyping will fix it. Go to the provider's identity-based recovery.
When every code genuinely fails
At some point the honest conclusion is that the codes are gone, and that is not the end of the account. It is the start of a slower process that runs on identity rather than on secrets.
The shape of it varies by provider and the timelines are real. GitHub, for example, warns that support "will not be able to restore access to accounts" with two-factor authentication enabled when the credentials and recovery methods are lost, but still offers a verification route: you "Begin account or email recovery", prove possession of something already linked to the account such as a verified device, SSH key or personal access token, and then "A member of GitHub Support will review your request and email you within three business days." Apple sits at the other extreme, because setting up a recovery key turns off the standard recovery process, and losing both the key and account access means you are "locked out of your account permanently".
Rather than repeat the per-provider routes here, we keep them in one place and maintain them there: lost authenticator app, no backup codes covers what Google, Microsoft, Apple, Meta, Discord, GitHub and the major exchanges each accept as proof, how long each takes, and which ones have no route at all. If the account in question is your email, read locked out of email and 2FA first, because the order you work in changes when the recovery mail cannot be received.
One practical thing to do before you start that process: stop making failed attempts from strange devices and networks. Several providers weigh recent sign-in behaviour when deciding how hard to make a recovery, and a trail of refusals from an unfamiliar location is the opposite of helpful.
Where KeyNesta fits, and what it cannot do
KeyNesta is an authenticator app, so it generates the thirty-second codes. It is not part of the backup-code system at all, and the limits are worth saying plainly on a page people land on while locked out.
KeyNesta never holds a service's backup codes, and cannot recover or validate one. There is no lookup we can run, no reissue we can perform and no way for us to tell you whether a code is live. Those codes exist only on the service's own servers and on whatever copy you kept. If GitHub or Google has retired a set, that happened entirely outside this app.
KeyNesta stores no passkeys and no security keys. Passkey storage and push approvals are listed as not planned on our roadmap, because they are a different product from an authenticator. If a hardware key is the answer for your highest-value account, that answer is not us.
KeyNesta has no account recovery on our side either. Nobody here can reset a forgotten passphrase, which is the direct cost of the zero-knowledge design described on our backup and sync page. A Recovery Kit and an encrypted backup file are things you make in advance, not things we can issue afterwards.
What the app does do, and what is worth five minutes once you are back in, is remove the reason you needed the sheet in the first place. Codes generated offline, an exportable encrypted vault, and the same entries on a second device mean a lost phone stops being a lockout. The backup codes then go back to being what they should be: an emergency route you never have to take.
Frequently asked questions
Is a backup code the same thing as a recovery code?
Usually yes, and occasionally no, which is exactly why this question causes lockouts. Most services use the two names for the same artifact: a short string, issued when you turned the second factor on, good for one use. GitHub says recovery codes, Google says backup codes, and they are the same kind of thing. The exception is a recovery key, which is a different artifact despite the similar name. Apple's recovery key is 28 characters and exists to help you regain access to the account, and it is used alongside a verification code rather than instead of one. If the string you are holding is long, has no hyphens, and came with wording about resetting your password or decrypting data, it is a key and belongs in a different flow.
Do I type the hyphens and the spaces, or leave them out?
Type it exactly as it was printed first, then try it stripped. GitHub's codes contain a hyphen by design, in the form xxxxx-yyyyy, so entering them as shown is correct there. For one long code split into groups, the separators are usually optional: Bitwarden's community answer on its own forum states that you can enter the recovery code "either with or without spaces". What you must not do is treat the groups as separate codes, because that is one code in parts. If both forms fail, the format is not your problem and you should move on to whether the set is still valid.
Can one backup code be used twice if the first attempt failed?
Yes, and that distinction matters when you are deciding how many attempts you have left. A rejected attempt does not consume a code, because the code is only marked inactive when it successfully authenticates you. Google's wording is "After you use a backup code to sign in, that code becomes inactive", and GitHub's is "once it has been used to authenticate, it cannot be used again". So the sheet is not being destroyed by your failures. The thing your failures do consume is the account's attempt allowance, which is why repeated retries eventually produce a refusal that has nothing to do with the code.
I downloaded my codes once and never touched them. Why are they refused?
Because something else retired them. The three usual causes are that a fresh set was generated at some point, that two-factor authentication was switched off and on again, or that the file you kept belongs to an earlier enrolment of the same account. GitHub is explicit that disabling and re-enabling 2FA means "the recovery codes in your security settings automatically update", and equally explicit that reconfiguring the second factor without disabling it "will not change your recovery codes". Nothing notifies you when a set dies, and the paper looks identical either way, so check for a newer copy before concluding the system failed.
The site says my code is invalid after several tries. Is the code wrong or am I locked out?
Treat several consecutive refusals as a sign you may now be fighting a throttle rather than a code. NIST's guidelines require verifiers to cap consecutive failed attempts, and permit measures such as a mandatory wait "that increases" with each failure, with an example range of thirty seconds up to an hour. Real systems are tighter: Microsoft Entra locks an account after ten failed attempts by default, with a lockout "one minute at first, and longer in subsequent attempts". The tells are a vaguer error message, an instant rejection, or a correct password suddenly failing too. Stop for fifteen minutes, then make a single best attempt.
Can KeyNesta look up or reissue a backup code for one of my accounts?
No, and no authenticator app can. Backup codes are issued and validated by the service that gave them to you, and they never touch this app: KeyNesta holds the seeds that generate your thirty-second codes, encrypted so that nobody here can read them, and nothing else. We cannot tell whether a code is live, cannot generate a replacement and cannot ask a provider on your behalf. The only route to a new set is signing in to that service and generating one, which is also the moment to write the date on the sheet.
Takeaway
The sentence worth keeping is that a refused backup code is almost never a mistyped backup code. It is a code from a set that something quietly retired, a code that was already spent, a code from the wrong file, or one long code that you are reading as several. Those four account for nearly all of it, and the fifth cause is the service refusing to listen because you asked too many times.
So work in order and keep your attempts cheap. Decide which artifact you hold before you type anything. Find the newest copy before you trust the one in your hand. Use the service's own recovery-code route rather than the ordinary prompt. Try a few entries, then stop and wait rather than cycling the whole sheet into a throttle. And when the set really is dead, switch to the provider's identity route early, because the hours spent retyping are hours that route could have been running.
Then make the next lockout boring. One dated sheet per account, codes crossed off as they are spent, stored somewhere you can reach without the phone you just lost, and a second device holding your authenticator entries so the sheet stays in the drawer.
Sources
- GitHub Docs, "Troubleshooting two-factor authentication issues"
- GitHub Docs, "Configuring two-factor authentication recovery methods"
- GitHub Docs, "Recovering your account if you lose your 2FA credentials"
- Google Account Help, "Sign in with backup codes"
- Microsoft Support, "Microsoft account recovery code"
- Bitwarden Help, "Recovery Code for Two-Step Login"
- Bitwarden Community, "Recovery codes 2FA not working"
- Apple Support, "Set up a recovery key for your Apple Account"
- NIST SP 800-63B-4, "Digital Identity Guidelines: Authentication and Authenticator Management"
- Microsoft Learn, "Prevent attacks using smart lockout"