What does 2FA mean?
Two-factor authentication (2FA) is a login method that asks for two different kinds of proof before it lets you in. The first proof is usually something you know, such as your password. The second proof is something you have, such as your phone, a security key, or a secret key saved in an authenticator.
The idea is simple: passwords leak all the time. They are reused on many websites, guessed, or stolen in phishing emails and data breaches. With 2FA turned on, an attacker who has your password still needs the second factor, which they normally do not have. That one extra step blocks most account takeovers.
Security experts sometimes add a third type of factor: something you are, such as a fingerprint or face scan. When a login uses two of these three types, it counts as two-factor authentication.
How does 2FA work?
Most websites use the same basic flow once 2FA is turned on:
- You enter your username and password as usual.
- The website asks for a second proof, most often a 6-digit 2FA code.
- You open your authenticator (an app, or a browser tool such as our 2FA code generator) and read the current code.
- You type the code. If it matches what the website expects for that moment, you are logged in.
The most common 2FA code is a TOTP code (time-based one-time password). When you set up 2FA, the website gives you a secret key, usually shown as a QR code. Your authenticator and the website both combine that secret key with the current time to calculate the same 6-digit number. Because the time changes, the 2FA code changes every 30 seconds, and an old code is useless to an attacker. You can read more in our guide What is TOTP?, or watch it happen with a 2FA live code and its countdown.
Common types of 2FA
Authenticator codes (TOTP)
An authenticator app or an online authenticator creates a new code every 30 seconds from your secret key. It works offline, does not depend on your mobile network, and is supported by almost every major website. This is the type of 2FA that our free 2FA tool generates.
SMS and email codes
The website sends a one-time code to your phone number or inbox. It is better than no 2FA, but text messages can be delayed, and a criminal who takes over your phone number (a "SIM swap") can receive your codes.
Push approvals
Some services send a notification to a trusted phone and you tap to approve. It is quick, but only approve requests you started yourself.
Security keys and passkeys
Hardware keys and passkeys use public-key cryptography and are very resistant to phishing. Many people combine them with authenticator codes as a backup.
2FA vs 2-step verification: is there a difference?
In everyday use, 2FA and 2-step verification mean almost the same thing. Both add a second step after your password. Some companies, such as Google, call their feature "2-Step Verification", while others call it "two-factor authentication".
Strictly speaking, 2-step verification only means there are two steps, while two-factor authentication means the two steps use different types of proof. A password plus a code from an authenticator counts as both. For normal users, the important part is the same: turn it on and keep your backup codes safe.
How to start using 2FA in 4 steps
- Open the security settings of an important account, such as your email.
- Choose authenticator app as your 2FA method if it is offered.
- Save the secret key or QR code, then paste the key into an authenticator or into our online 2FA code generator to get your first 6-digit code.
- Enter the code to finish, and store the backup codes the website gives you somewhere safe and offline.
Start with your email account. Whoever controls your email can usually reset the passwords of your other accounts, so it deserves the strongest protection.
Frequently asked questions
What is a 2FA code?
A 2FA code is a short, temporary number, usually 6 digits, that you enter after your password. It proves you also have your second factor, such as an authenticator holding your secret key.
Is 2FA really worth it?
Yes. Most account takeovers start with a leaked or reused password. A second factor stops an attacker who only has your password, and setting it up takes only a few minutes.
Is 2FA the same as 2-step verification?
For most people, yes. Both add a second step after your password. Two-factor authentication specifically means the two steps use different kinds of proof, such as a password and a code from an authenticator.
Which type of 2FA is the safest?
Security keys and passkeys resist phishing best. Authenticator codes (TOTP) are a strong and widely supported choice, and they are safer than SMS codes because they cannot be stolen through a SIM swap.