What is 2FA? Two-factor authentication explained simply
Two-factor authentication (2FA) means logging in with two different kinds of proof: something you know (your password) and something you have (usually your phone). Even if someone steals your password, they can't get in without the second factor.
How authenticator codes work
When you turn on app-based 2FA, the website shows a QR code containing a secret key. Your authenticator app (such as Google Authenticator or Microsoft Authenticator) stores that key. Every 30 seconds, the app combines the key with the current time to calculate a new 6-digit code. The website does the same calculation, so when the codes match, it knows you have the key. This method is called TOTP, time-based one-time passwords, and is defined in an open standard (RFC 6238).
SMS codes vs authenticator apps
Codes sent by text message are better than nothing, but they can be intercepted, for example through "SIM swap" fraud, where criminals convince a mobile operator to move your number to their SIM. Authenticator apps work offline and are generally more secure. Hardware security keys are stronger still.
Don't get locked out
- Save your backup codes when you set up 2FA, and keep them somewhere safe, offline.
- Keep a copy of the secret key for important accounts in a secure place, or use an authenticator app with encrypted backup.
- Moving to a new phone? Transfer your authenticator accounts before you reset the old one.
Codes not working?
Because codes depend on time, the most common cause of rejected codes is a wrong clock on your phone or computer. Set the time to update automatically.
Generating a code in your browser
If you have a secret key, for example while setting up an account on a computer, DocNova's 2FA code generator shows the current code. The key is processed only in your browser and never saved. Treat 2FA keys like passwords, and use an authenticator app for everyday logins.
Frequently asked questions
What is a 2FA code?
A short one-time code, usually 6 digits, that you enter after your password to prove you have your phone or security key. It comes from an authenticator app, a text message or an email.
How long does a 2FA code last?
Authenticator app codes change every 30 seconds. Codes sent by text or email usually last a few minutes; the site tells you how long.
What if I lose my phone with 2FA on it?
Use the backup codes you saved when you turned on 2FA, or the site's account recovery process. Keep backup codes somewhere safe, away from your phone.
Is SMS 2FA safe?
It is much safer than a password alone, but an authenticator app or security key is safer still, because text messages can be intercepted or moved to another SIM card.
This guide is general information, not legal, tax or accounting advice. Rules differ by country.