Recovery Code
A recovery code is a backup credential that lets you regain access to an account when your usual sign-in method is unavailable, such as when you forget your password or cannot complete multifactor authentication. It is typically issued in advance and stored safely so it can be used if you lose access to your phone or other authentication device. Because it can bypass a normal login step, it should be protected as carefully as a password.
A recovery code is a pre-issued backup credential used to restore account access when a primary authentication factor or MFA method is unavailable. In common deployments it functions as a possession-style secret that either substitutes for a lost factor or, depending on the provider, is used alongside other trusted elements (for example a trusted phone number and device) to complete account recovery. Implementations vary: some are single-use codes consumed on redemption (as in one-time backup codes), while others are longer fixed-format keys (for example a 25-character or 28-character code in specific vendor implementations). Because a recovery code can bypass a normal authentication factor, it should be treated as a high-value secret and stored securely; the exact recovery flow, format, and reuse behavior are provider- and configuration-dependent.
Why it matters
Recovery codes address a fundamental fragility in modern authentication: when a primary factor is lost or unavailable, a forgotten password, a lost phone, a changed phone number, or an inaccessible authenticator app, the user risks being permanently locked out of their account. By issuing a backup credential in advance, providers give account holders a path back in without depending solely on a device or channel they may no longer control. This is why services such as Google offer backup codes for use when a phone cannot receive codes by text, call, or authenticator app.
The same property that makes recovery codes useful also makes them dangerous. Because a recovery code can bypass a normal authentication factor, anyone who obtains it can potentially complete a recovery flow and take over the account. This inverts the usual security benefit of MFA: the recovery path becomes an alternative attack surface if the code is stored insecurely, screenshotted, emailed to oneself, or otherwise exposed. For this reason the code should be treated as a high-value secret and protected as carefully as a password.
In machine and non-human identity (NHI) contexts, this concern is amplified. As noted in NHI security guidance, a recovery code that bypasses a primary factor must be handled as a secret and subject to the same protection and hygiene expectations applied to other credentials, rather than being left in plaintext or shared across systems.
Who it's relevant to
Inside Recovery Code
Common questions
Answers to the questions practitioners most commonly ask about Recovery Code.
