Quick answer
Two-factor authentication (2FA) adds a second check when you sign in, on top of your password, such as a code from an app or a tap on your phone. Even if someone steals your password, they cannot get in without that second factor. It is one of the simplest and most effective ways to protect your email, bank and social media accounts. Authenticator apps, security keys and passkeys are safer than text-message codes.
Most account takeovers start with a stolen or guessed password. Two-factor authentication (2FA) stops the large majority of these attacks by adding a second check that a criminal on the other side of the world doesn’t have, yet many people still haven’t switched it on for their most important accounts.
This guide explains how 2FA works, compares the main options from text codes to passkeys, shows the tricks attackers use to get around it, and walks you through setting it up. It is part of our privacy and security explainers.
The three kinds of “factor”
- Something you know: a password or PIN.
- Something you have: your phone, a security key or a bank card.
- Something you are: your fingerprint or face.
2FA combines two different kinds. Two passwords don’t count, because a thief who can steal one can usually steal both. Multi-factor authentication (MFA) is the broader term for using two or more.
What happens when you sign in with 2FA
Many services remember a trusted device after the first sign-in, so you are not asked for the second factor every time on your own phone or laptop. You will be asked again when someone signs in from a new device, which is exactly when the check matters.
The main types of 2FA, from weakest to strongest
| Method | How it works | Security |
|---|---|---|
| Text message (SMS) code | A code is texted to your phone | Better than nothing, but vulnerable to SIM-swap scams and phishing |
| Email code | A code is sent to your inbox | Only as safe as your email account |
| Authenticator app | An app shows a code that changes every 30 seconds | Strong for most people |
| Push notification | You tap “Yes, it’s me” on your phone | Strong, but beware unexpected prompts |
| Security key or passkey | A physical key or your device proves who you are cryptographically | Strongest; resistant to phishing |
How authenticator apps make their codes
Apps such as Google Authenticator, Microsoft Authenticator and many password managers use an open standard called TOTP (time-based one-time passwords). When you set up 2FA, the website and the app share a secret key, usually by scanning a QR code. Every 30 seconds both sides combine that secret with the current time to calculate the same six-digit code. No internet or mobile signal is needed, which also makes app codes harder to intercept than text messages.
Why 2FA works so well
Criminals obtain passwords through data breaches, phishing emails and guessing. With 2FA, a stolen password alone is not enough, because the attacker also needs your phone, key or fingerprint. The US Cybersecurity and Infrastructure Security Agency says that using MFA makes you significantly less likely to be hacked, and recommends phishing-resistant methods such as security keys and passkeys wherever they are offered.
US government identity guidelines from NIST, the SP 800-63B standard, also treat cryptographic methods like security keys and passkeys as the strongest form of authentication, and place restrictions on less secure methods such as SMS.
Watch out for these tricks
“MFA fatigue” attacks deserve a special mention: an attacker who already has your password triggers sign-in prompts again and again, hoping you’ll tap “Approve” just to make them stop. If you get a prompt you didn’t expect, deny it and change your password straight away.
How to turn on 2FA, step by step
- Start with your main email account, since it can reset everything else.
- Then banking, payment apps, social media, cloud storage and your password manager.
- In each account, open Security settings and look for “2-Step Verification”, “Two-factor authentication” or “Passkeys”.
- Choose a passkey, security key or authenticator app over SMS where available.
- Scan the QR code with your authenticator app and enter the code it shows to confirm.
- Save the backup codes somewhere safe, such as a password manager or a printed copy kept at home.
- Add a second method, such as a second device, so you’re not locked out if you lose your phone.
If a service supports passkeys, they combine both factors in one simple step. Our passkey guide explains how they work and how to set them up.
If you lose your phone
- Use one of your saved backup codes to sign in.
- Sign in on another trusted device and register your new phone.
- If your authenticator app supports cloud backup, restore it on the new phone.
- Use the service’s account recovery process as a last resort; it may take several days for security reasons.
- Ask your mobile operator to block the old SIM if the phone was stolen.
Key takeaways
- 2FA adds a second, different kind of check on top of your password.
- It blocks most attacks that rely on stolen passwords.
- Authenticator apps, security keys and passkeys beat SMS codes.
- Authenticator apps use time-based codes that work without a signal.
- Never share codes or approve prompts you didn’t start.
- Turn it on first for email, save backup codes, and add a second device.
Frequently asked questions
Is 2FA the same as MFA?
2FA uses exactly two factors; MFA means two or more. In everyday use the terms are often interchangeable.
What if I lose my phone?
Use the backup codes you saved when setting up 2FA, or a second registered device. Some services also offer account recovery checks.
Is SMS 2FA worth using?
Yes, it is much better than a password alone. But switch to an app, security key or passkey for important accounts if you can.
Does 2FA slow me down?
Slightly, and many services remember trusted devices so you are not asked every time.
Can 2FA be bypassed?
Sophisticated phishing can trick people into handing over codes. Phishing-resistant methods such as passkeys and security keys prevent this.
What are backup codes?
One-time codes a service gives you when you turn on 2FA. Each works once and lets you in if you lose your phone, so store them safely offline or in a password manager.
Is 2FA required by law?
Some industries, such as online banking in many countries, must use strong customer authentication. For personal accounts, it is usually optional but strongly recommended.


