Security & privacy

What is two-factor authentication, and which kind should you use?

Two-factor authentication stops most account takeovers. Here is how it works, how the methods compare, and how to set it up without locking yourself out.

Cursorlane Editorial TeamSoftware & tools 5 min read
A person at a desk holding a phone next to a laptop showing a login screen, with a small key on the table

Two-factor authentication (2FA) adds a second check to your login, so a stolen password alone is no longer enough to get into your account. It is one of the most effective security steps an everyday user can take, and it usually takes less than five minutes per account.

This guide explains what the 'two factors' are, how the common methods compare, which accounts to protect first, and how to avoid the most common problem with 2FA: locking yourself out.

What does two-factor authentication actually mean?

Security people group proof of identity into three kinds of factor: something you know (a password or PIN), something you have (a phone or a hardware key), and something you are (a fingerprint or face). Two-factor authentication asks for two different kinds. A password plus a code from your phone counts. Two passwords do not.

The idea is simple. Passwords leak all the time, through data breaches, phishing pages and reuse across sites. If a criminal has your password but not your phone or key, the login fails. You may also see the terms multi-factor authentication (MFA) and two-step verification. For everyday purposes they mean the same thing.

In practice, you usually see the second step only when you sign in on a new device or browser, or after you clear your cookies. Most services remember a trusted device for a while, so the extra step does not appear every time you open your email. That is why 2FA costs so little effort once it is set up.

Which 2FA methods are there, and how do they compare?

Not every second factor is equally strong. The weakest is a code sent by text message, because phone numbers can be hijacked through SIM swapping, where someone convinces a mobile carrier to move your number to their SIM card. Even so, SMS codes are far better than no second factor at all.

Stronger options generate the code on your own device or use cryptography that cannot be phished. Here is the usual order, from strongest to weakest:

  • Hardware security keys and passkeys: a small USB or NFC key, or a credential stored on your device, that only works on the real website.
  • Authenticator apps: an app on your phone that shows a new six-digit code every 30 seconds, based on the TOTP standard.
  • Push prompts: the service sends an 'Is this you?' notification to an app you are signed into.
  • SMS or voice codes: a code sent to your phone number.
  • Email codes: only as safe as your email account.
If a criminal has your password but not your phone or key, the login fails.

How do authenticator codes work without the internet?

When you scan a QR code to set up an authenticator app, the website and your app share a secret key. From then on, both sides combine that secret with the current time and run it through the same formula. Because they do the same maths, they arrive at the same six digits, and the code changes every 30 seconds.

This is why authenticator apps work in airplane mode, and why the clock on your phone matters. If codes are rejected, check that your phone sets its time automatically. It also means the secret lives on your phone, so losing the phone without a backup is the main risk.

Which accounts should you protect first?

Start with the accounts that can reset everything else. Your main email account is the master key: anyone who controls it can click 'forgot password' on almost every other service you use. Protect it first, then work outward.

A sensible order for most people:

  • Your primary email account
  • Your phone's cloud account (the one that backs up photos and contacts)
  • Online banking and payment accounts
  • Your password manager, if you use one
  • Social media and messaging accounts, which are often hijacked for scams
  • Work accounts, following your employer's rules

How do you avoid locking yourself out?

The most common 2FA disaster is not a hacker. It is a lost, broken or reset phone. When you enable 2FA, most services offer a set of one-time backup codes. Print them or write them down and keep them somewhere safe at home, such as with important documents. Each code works once.

Add more than one second factor where you can, such as an authenticator app plus a hardware key, or two keys kept in different places. Check whether your authenticator app can back up or move its codes to a new phone, and test that before you need it. When you change phones, move your 2FA codes before you wipe the old device.

Can two-factor authentication still be beaten?

Yes, sometimes. A convincing fake login page can ask for your password and your six-digit code, then use both straight away on the real site. Criminals also send floods of push prompts hoping you tap 'approve' to make them stop. Some people get phone calls from someone pretending to be support, asking them to read out a code.

The defences are habits as much as technology. Never share a login code with anyone, including someone who says they work for the company. Never approve a prompt you did not trigger. Where it is offered, prefer passkeys or hardware keys, because they check the website's real address and simply refuse to work on a lookalike.

Frequently asked questions

Is two-factor authentication worth the hassle?

+

Yes. It blocks the large majority of attacks that rely on stolen or reused passwords. Most services only ask for the second factor on new devices, so day-to-day it adds very little effort.

Is SMS two-factor authentication safe?

+

It is much better than a password alone, but it is the weakest common method because phone numbers can be hijacked. If a service offers an authenticator app, a passkey or a security key, choose that instead.

What happens if I lose my phone with my authenticator app?

+

Use the backup codes you saved when you set up 2FA, or a second factor you registered. If you have neither, you will need the service's account recovery process, which can be slow. Saving backup codes avoids this.

What is the difference between 2FA and MFA?

+

Two-factor authentication uses exactly two factors. Multi-factor authentication means two or more. In everyday use the terms are interchangeable.

Should I turn on 2FA for every account?

+

Turn it on for every account that matters, starting with email, banking and your phone's cloud account. For low-value accounts it is still good practice, as long as you keep your backup codes organised.

Why does my authenticator code keep failing?

+

The most common cause is a phone clock that is out of sync. Set your phone to use automatic network time and try again. Also check you are reading the code for the right account.

Pick one account today, ideally your email, and turn on two-factor authentication with the strongest method it offers. Save the backup codes, then repeat for the next account on the list.

How we research: Guides are written from established sources and checked for accuracy. They are general information, not professional advice.

Written by

Cursorlane Editorial Team

Software & tools

Our writers are developers and heavy software users who test what they write about and update guides when the tools change.

More Stories

View all →