How to get a 2FA code: the 4 sources and which one you have
A 2FA code comes from one of four sources: the authenticator app you scanned the QR code with, the secret key (paste it into an app or Code2FA), an SMS/email sent by the service, or backup codes if your phone is lost.

A site asks for your "2FA code" and you are not sure where to get it? It always comes from one of these four sources, depending on how 2FA was set up.
1. From an authenticator app on your phone
If you scanned a QR code with Google Authenticator, Microsoft Authenticator, 2FAS, Authy… when turning on 2FA, open that app and find the service's entry. The 6-digit code changes every 30 seconds; type the current one, not one about to expire.
Account missing from the app? You may have added it to another app or phone, or switched phones without moving it. See moving Google Authenticator to a new phone.
2. From the secret key (setup key)
The secret key is the string of letters A–Z and digits 2–7 behind the QR code, for example JBSWY3DPEHPK3PXP. With the key, any authenticator produces the right code:
- Open Code2FA on your phone or computer.
- Paste the key (or an
ID|Pass|2FAline, or anotpauth://link). - The 6-digit code appears instantly; tap to copy. Codes are computed in your browser and the key is not sent anywhere.
Keys usually live in the note you saved when enabling 2FA, in your password manager, or in the details a seller sent with an account. See what a secret key is and where to find it.
3. From SMS or email
Some services text or email the code. Those codes are created by the service, so you cannot generate them with an app or key. If nothing arrives within two minutes, resend or choose another method. See is SMS OTP safe.
4. Backup codes when your phone is gone
If you lost the authenticator and have no key, use the backup codes you saved when enabling 2FA. Each works once. Without them, you'll need the service's account recovery process.
Have a code but it's rejected?
It's almost always a phone clock that is off, or a code from a different account. See 7 causes of rejected 2FA codes.
FAQ
Where do I get my 2FA code?
From the authenticator app you used when turning on 2FA, from the secret key (pasted into an app or Code2FA), from SMS/email if the service sends codes, or from backup codes if you lost your phone.
Can I get a 2FA code without my phone?
Yes, if you still have the secret key (paste it into Code2FA on a computer) or backup codes. Without either, you need the service's account recovery.


