How to Turn On Two-Factor Authentication on Facebook (and Why It Asks for a Code Every Time)

Two-factor authentication (2FA) asks for a login code or a confirmation whenever someone logs in to your Facebook from a browser or device Meta doesn’t recognize, so a stolen password isn’t enough. Here’s how to turn it on on each device, which method to pick, and why Facebook may keep asking for a code every time you log in.

Quick answer

Go to Settings & privacy > Settings > Accounts Center > Password and security > Two-factor authentication, pick your account, then choose a method: a security key, an authentication app or text message (SMS) codes. You can also get 10 recovery codes for when you can’t use your phone. Save the browser or device you’re using (not a public computer) so you aren’t asked for a code every time. If you use private browsing or clear your history when the browser closes, Meta says you may need a code each time.

Does this match what you see?

  • You want to add a second step to your Facebook login.
  • You’re not sure whether to use SMS, an authenticator app or a security key.
  • Facebook asks for a code every time you log in on the same computer.
  • Facebook says you must turn on two-factor authentication.

iPhone & iPadAndroidComputer (browser)

Steps come from Meta’s help page for each device, including iPad, Facebook Lite and mobile browsers. Meta is gradually moving people to Meta Accounts (external site, opens in a new tab), so you may see Meta Account instead of Accounts Center.

Why this happens: the possible causes

Why Facebook might keep asking for a code, according to Meta.

Two-factor questions and where to go
What you seePossible causeDo this
A code every time on the same computerPrivate browsing, or history cleared when the browser closesSave your browser
A code on a new phone or browserMeta doesn’t recognize that device yetEnter the code, then save the device
No code arrivesUsually an SMS or app problem (our view)Login code not received
  • Your browser forgets youPossible

    Meta says it needs to remember your computer and browser to recognize them; private browsing or clearing history on close can stop this, so you may need a code each time.

Try these 60-second checks first

  • Have your phone with you before you start.
  • Save your recovery codes somewhere safe.
  • Don’t save the browser on a public computer.

How to fix it, step by step

Work through these in order. They start with the quickest, safest checks and only move to steps that sign you out or remove data later.

Fix 1: Turn on two-factor authentication (Meta’s steps)

May sign you out5 miniPhone & iPadAndroidComputer (browser)

Meta says 2FA asks for a special login code, or for you to confirm the login, each time someone tries to access your account from a browser or device it doesn’t recognize.

iPhone & iPad

  1. Tap Menu in the top left of Facebook (on an iPad, bottom right).
  2. Scroll down and tap Settings & privacy, then Settings.
  3. Tap Accounts Center, then Password and security. On iPad, skip Accounts Center: tap Password and security below Account.
  4. Scroll down and tap Two-factor authentication. You may be asked for your password. (On iPad, then tap Go to Accounts Center.)
  5. Tap your account, choose a security method and follow the on-screen instructions.

Android

  1. Tap Menu in the top left of Facebook.
  2. Scroll down and tap Settings & privacy, then Settings.
  3. Tap Accounts Center, then Password and security.
  4. Scroll down and tap Two-factor authentication, then your account.
  5. Choose a security method and follow the on-screen instructions.

Computer (browser)

  1. Click your profile picture in the top right, then Settings and privacy.
  2. Click Settings.
  3. Click Accounts Center, then Password and security.
  4. Click Two-factor authentication, then your account.
  5. Choose a security method and follow the on-screen instructions.

In Facebook Lite or a mobile browser: Menu (top right) > Settings > Accounts Center > Password and security > Two-factor authentication. In Lite and a mobile browser, Meta says that when it’s on, a checked box appears next to Two-factor authentication at the top of your settings. You can also turn on alerts about unrecognized logins. Quicker route: Meta’s Security Checkup reviews your account and recommends turning on two-factor authentication and login alerts. Find it under Accounts Center > Password and security > Security Checkup (on iPad, Check Your Important Security Settings), or start it on a computer (external site, opens in a new tab). Meta says it works on a computer or the latest Facebook app.

Did it work? Two-factor authentication shows as on.

Fix 2: Choose a method, and get your 10 recovery codes

May sign you out5 miniPhone & iPadAndroidComputer (browser)

Meta asks you to choose one of three security methods when you turn on 2FA.

  1. Security key: tap a physical security key on a compatible device (how keys work).
  2. Authentication app: use login codes from a third-party authentication app (how to set it up).
  3. Text message (SMS): get 6-digit codes by text (how to set it up). You can add a new mobile number or use one already on your account (how Facebook uses that number (external site, opens in a new tab)).
  4. Then get your 10 recovery codes for when you can’t use your phone (how).

Our advice: an authentication app or security key doesn’t depend on text messages, which helps if you travel or change SIM. Meta also suggests creating a passkey for an easier, more secure login. Keep in mind that Meta says your two-factor phone number can’t be used to reset your password, so Meta says to add a different mobile number or email address.

Did it work? You have a method set up and your recovery codes saved.

Fix 3: Set up an authentication app (Meta’s steps)

May sign you out5 miniPhone & iPadAndroidComputer (browser)

An authentication app, such as Google Authenticator or LastPass, generates login codes on your phone. Meta says you can only add one if you already have access to your account, and that it’s best to install the app on the device you normally use for Facebook.

iPhone & iPad

  1. Install an authentication app on your iPhone.
  2. Tap Menu (top left) > Settings & privacy > Settings > Password and security.
  3. Tap Two-factor authentication, then your account, then Authentication app.
  4. Follow the set-up instructions and tap Next, then enter the code from the app and tap Next.
  5. On an iPad: Menu (bottom right) > Settings & privacy > Settings > Password and security (below Account) > Two-factor authentication > Go to Accounts center > your account (you may re-enter your password) > Authentication App > Continue.

Android

  1. Install an authentication app on your phone.
  2. Tap Menu (top left) > Settings & privacy > Settings > Password and security.
  3. Tap Two-factor authentication, then your account, then Authentication app.
  4. Follow the set-up instructions and tap Next, then enter the code from the app and tap Next.

Computer (browser)

  1. Install an authentication app on the phone you normally use.
  2. Click your profile picture (top right) > Settings & privacy > Settings.
  3. Click Accounts Center > Password and security > Two-factor authentication, then your account.
  4. Click Authentication app, follow the set-up instructions and click Next.
  5. Enter the code generated by the app, then click Next.

Steps don’t match? Meta says not everyone can reach this setting in Accounts Center or Meta Account yet. Try the older route: on a computer, go to Security and Login Settings (external site, opens in a new tab) > Use two-factor authentication > Edit > Use Authentication App; in the iPhone or Android app, Password and security > Use two-factor authentication > Authentication App > Continue. In Facebook Lite or a mobile browser: Menu (top right) > Settings > Accounts Center > Password and security > Use two-factor authentication > Get Started > your account > Use authentication app. Already locked out? An app can’t be added then: see login code not received.

Did it work? The app shows a Facebook code, and Facebook accepted it.

Fix 4: Use text messages (SMS): set up, switch or turn off

May sign you out5 miniPhone & iPadAndroidComputer (browser)

With SMS, Meta sends a 6-digit code by text whenever someone logs in from a device or browser it doesn’t recognize. Meta says to make sure you’re viewing your personal profile before you start.

iPhone & iPad

  1. Tap Menu (top left) > Settings & privacy > Settings > Password and security.
  2. Tap Two-factor authentication, then your account.
  3. Tap Text message (SMS) > Next, choose a number already on your account or add a new one, then tap Next.
  4. On an iPad: Menu (bottom right) > Settings & privacy > Settings > Password and security > Use two-factor authentication > Go to Accounts center > your account > SMS or WhatsApp.

Android

  1. Tap Menu (top left) > Settings & privacy > Settings > Password and security.
  2. Tap Two-factor authentication, then your account.
  3. Tap Text message (SMS) > Next, choose a number already on your account or add a new one, then tap Next.

Computer (browser)

  1. Click your profile picture > Settings & privacy > Settings > Accounts Center > Password and security.
  2. Click Two-factor authentication, then your account.
  3. Click Text message (SMS) > Next, choose a number already on your account or add a new one, then click Next.

In Facebook Lite or a mobile browser, the option is called SMS or WhatsApp (Menu is at the top right). Meta says to also set up a second method, such as recovery codes or a security key, in case your phone is lost, stolen or hacked. Switching or turning off SMS: you need an authentication app or security key first; Meta says that if you click Turn off next to your number without one of those, two-factor authentication turns off too. Facebook doesn’t charge for these texts, but your carrier’s standard rates apply. Privacy: Meta says a number added for two-factor authentication is used to help you log in and keep your account safe, while numbers added elsewhere (for example on your profile or in Marketplace) may also be used for things like friend suggestions or ads.

Did it work? Your number is listed for text message codes.

Fix 5: Get your 10 recovery codes (do this now)

Safe & reversible3 miniPhone & iPadAndroidComputer (browser)

Meta says that once two-factor authentication is on, you can get 10 recovery codes to use when you can’t use your phone, in place of your usual code. Each works once.

  1. Open Settings & privacy > Settings > Accounts Center > Password and security > Two-factor authentication, and choose your account. You may need to re-enter your password. (On an iPad: Password and security > Use two-factor authentication > Go to Accounts Center.)
  2. Below How you get login codes, choose Additional methods, then Recovery codes.
  3. Choose Get new codes (or Show codes in the apps).
  4. Print or write down the 10 codes and keep them somewhere safe, away from your phone (our advice).

Ran out or lost them? Meta says choose Get new codes again. Meta also says some features may not be available to everyone. Locked out and need to use one? See use a saved recovery code.

Did it work? You have 10 codes saved somewhere other than your phone.

Fix 6: Use a security key (and don’t get locked out if you lose it)

May sign you out10 miniPhone & iPadAndroidComputer (browser)

A security key is a small device you plug in or hold near your phone or computer. Meta calls it one of the best ways to secure your account, because a login from an unrecognized browser or device needs you to physically approve it with the key, even if someone has your password.

iPhone & iPad

  1. Buy your own U2F or FIDO2 security key. Some plug into a USB or Lightning port; others are held near your computer or phone. Meta says to check it works with your browser and device before buying.
  2. On an iPhone (iOS 13.3 or later, with a Lightning or NFC key): Menu (top left) > Settings & Privacy > Settings > Meta Account > Login and security > Two-factor authentication (you may re-enter your password) > Security keys. Plug in and activate the key, or hold it near the top of your phone, tap Register security key, then Done once it’s verified.
  3. On an iPad (iOS 13.3 or later, Lightning or NFC key): Menu (bottom right) > Settings & Privacy > Settings > Login and security (below Meta Account) > Use two-factor authentication > Go to Meta Account > your account (you may re-enter your password) > Security keys. Plug in and activate the key, or hold it near the top of the device, then tap Register security key and Done once it’s verified. No Security keys option? Meta says you may need to update the app.
  4. Then log in with your key (external site, opens in a new tab) from now on.
  5. Set up a backup method too. Meta says the most secure option is more than one key; otherwise add text message codes or an authentication app, so you aren’t locked out if you lose the key.

Android

  1. Buy your own U2F or FIDO2 security key. Some plug into a USB or Lightning port; others are held near your computer or phone. Meta says to check it works with your browser and device before buying.
  2. On Android (Android 7 or later, with a Bluetooth, USB or NFC key): Menu (top left) > Settings & Privacy > Settings > Accounts Center > Password and security > Two-factor authentication > your account (you may re-enter your password) > Security key > Continue. Plug in and activate the key, or hold it near the top of your phone, tap Register security key, then Done.
  3. Then log in with your key (external site, opens in a new tab) from now on.
  4. Set up a backup method too. Meta says the most secure option is more than one key; otherwise add text message codes or an authentication app, so you aren’t locked out if you lose the key.

Computer (browser)

  1. Buy your own U2F or FIDO2 security key. Some plug into a USB or Lightning port; others are held near your computer or phone. Meta says to check it works with your browser and device before buying.
  2. On a computer (latest Chrome, Opera, Firefox, Edge or Safari): Settings and privacy > Settings > Meta Account > Login and security > Two-factor authentication (you may re-enter your password) > Security keys. Insert your key, click Register security key and follow the instructions. No Register Security Key option? Meta says you may need to update your browser.
  3. Then log in with your key (external site, opens in a new tab) from now on.
  4. Set up a backup method too. Meta says the most secure option is more than one key; otherwise add text message codes or an authentication app, so you aren’t locked out if you lose the key.
  5. Keep a backup method for browsers that don’t support keys. Meta lists Chrome, Opera, Firefox, Edge and Safari, plus mobile devices, as supported.

In a mobile browser: go to Security and login settings (external site, opens in a new tab) > Accounts Center > Password and security > Two-factor authentication > your account > Security key > Continue, then register the key and tap Done. Lost your key? Meta says a key doesn’t replace your password: whoever finds it still needs your username and password to log in. Use your backup method or recovery codes. Key won’t register or work? Meta’s checklist: make sure a USB or Lightning key is plugged in properly; tap the sensor or button on touch-activated keys; move NFC keys slowly near your device’s sensor; keep Bluetooth keys charged; check the maker’s instructions; update your browser or app. Meta also suggests clearing your cache and temporary data and restarting your device; on Linux, an extra setup step is needed. Your key can also be used with other websites.

Did it work? Your key is listed as a two-factor method, alongside a backup method.

Fix 7: Asked for a code every time? Save your browser

Safe & reversible2 minComputer (browser)

Meta says it needs to remember your computer and browser to recognize them next time, and some browser features block this.

Computer (browser)

  1. When you’re asked, choose to save the browser or device. Meta says you then won’t need a code when you log in again there.
  2. Don’t click Save this browser on a public computer that other people use.
  3. If you use private browsing, or your browser clears history when it closes, Meta says you may need a code each time (external site, opens in a new tab). Our tip: log in in a normal window, or change that browser setting.

Did it work? You aren’t asked for a code the next time you log in on that browser.

Fix 8: Code not arriving, or locked out?

Safe & reversible1 miniPhone & iPadAndroidComputer (browser)

That’s a different problem, with its own guide.

  1. See Facebook login code not received for SMS, authenticator, recovery code and “try another way” fixes.
  2. Meta also has a page on trouble logging in with two-factor authentication (external site, opens in a new tab).

Did it work? You’re back in.

How to know it worked

  • Two-factor authentication shows as on in Password and security.
  • Your recovery codes are saved somewhere safe.
  • You aren’t asked for a code on your own, saved browser.

Still not working? Your next steps

  1. Required to turn on extra security? See Facebook Advanced Protection.
  2. Can’t log in at all? See can’t log in to Facebook.

Official help routes

SocialAppFix can’t see or change your account. For account decisions, recovery and appeals, only the platform’s own tools can help. These links go to the official sites.

Frequently asked questions

Does Facebook use my two-factor phone number for ads?

Meta says a number added for two-factor authentication is used to help you log in and keep your account safe. Numbers added in other places, such as your profile or Marketplace, may be used for other purposes, including suggesting friends or providing ads.

What happens if I turn off text message codes?

Meta says that if you turn off your phone number without an authentication app or security key on your account, two-factor authentication turns off too. Add another method first.

How do I turn on two-factor authentication on Facebook?

Settings & privacy > Settings > Accounts Center > Password and security > Two-factor authentication, choose your account, then pick a security key, authentication app or text message codes.

Why does Facebook ask for a code every time I log in?

Meta says it needs to remember your browser. If you use private browsing or clear your history when the browser closes, you may need a code each time. Save the browser when asked (not on a public computer).

How many recovery codes does Facebook give?

Meta says you can get 10 recovery login codes to use when you can’t use your phone.

Can I use my two-factor phone number to reset my password?

No. Meta says the mobile number you use for two-factor authentication can’t be used to reset your password, so add another phone number or email.

Sources and how we checked this guide

We base steps on the platforms’ own help pages and the phone makers’ official guides. Menu names change often and can differ by device, app version and region. Where a platform page could not be independently read, we link it so you can check the current wording yourself.

  1. How Facebook uses your mobile phone number for two-factor authentication (external site, opens in a new tab)Facebook Help Center · checked 21 October 2026
  2. Add a security key to your Meta Account (external site, opens in a new tab)Facebook Help Center · checked 21 October 2026
  3. Using Security Checkup to add security to your Meta Account (external site, opens in a new tab)Facebook Help Center · checked 21 October 2026
  4. Keep your Facebook profile secure (external site, opens in a new tab)Facebook Help Center · checked 20 October 2026
  5. How security keys work on Facebook (external site, opens in a new tab)Facebook Help Center · checked 21 October 2026
  6. Use text messages (SMS) for two-factor authentication on Facebook (external site, opens in a new tab)Facebook Help Center · checked 21 October 2026
  7. Using an app for two-factor authentication on Facebook (external site, opens in a new tab)Facebook Help Center · checked 21 October 2026
  8. How two-factor authentication works on Facebook (external site, opens in a new tab)Facebook Help Center · checked 20 October 2026
  9. Set up Facebook login recovery codes (external site, opens in a new tab)Facebook Help Center · checked 20 October 2026
  10. Change or reset your Facebook password (external site, opens in a new tab)Facebook Help Center · checked 20 October 2026
  11. About Meta Accounts (external site, opens in a new tab)Meta Help Center · title checked 21 October 2026

Last reviewed 22 October 2026 by the SocialAppFix editorial team against the sources above. Next scheduled review: 20 January 2027. How we write and review guides.

What changed
  • 22 October 2026: Added Meta’s steps to register a security key and its troubleshooting checklist, from help/1167409720358611.
  • 22 October 2026: Added how security keys work, backups and lost keys, from help/401566786855239.
  • 22 October 2026: Added Meta’s steps to get recovery codes, from help/148104135383285.
  • 22 October 2026: Added text message (SMS) setup and the rules for switching or turning it off, from help/1756727521321961.
  • 22 October 2026: Added Meta’s steps to set up an authentication app on every device, from help/358336074294704.
  • 22 October 2026: First published.

SocialAppFix is an independent guide and is not affiliated with or endorsed by Meta or Facebook. We never ask for passwords, login codes or payment to fix an account.