Security Social Media

How to Use Facebook Two-Factor Authentication and Mobile Code Generator

Tina Sieber Updated 14-05-2020

The best way to secure your Facebook account is to enable two-factor authentication (2FA), formerly known as login approvals. Once enabled, you will need a login or verification code every time you want to log into your Facebook account from a new device. This feature will protect your account from hackers, even if your password is weak.


Facebook can deliver the login code to your mobile phone number. Alternatively, you can use an authentication app or Facebook’s own Code Generator app on your phone or tablet to “manually” generate a code. If you set up all supported 2FA methods, you’ll be able to log into Facebook, even when you’re offline or can’t receive text messages.

Let us show you how to set up two-factor authentication and Code Generator on your mobile device. We’ve illustrated these steps on Android, but they should work just the same on an iPhone.

What Are Facebook Login Codes?

Facebook uses login or confirmation codes, also known as two-factor authentication, as an additional layer of security. 2FA will make it harder for someone to hack your Facebook account. If someone tries to log into your account from a device that you haven’t previously authorized, they will need both your password and a login code.

Enter Your Login Code window as shown on the desktop version of Facebook.

Moreover, when someone attempts to log into your account from another computer—and if you don’t use an authentication app—you will receive an indirect notification of this login attempt in form of a text message containing a security code.


That said, you can also enable login alerts and have them sent to your email address, Facebook, or Messenger account. In your Facebook mobile app, tap the hamburger menu, expand Settings & Privacy, select Settings > Security and Login > Get alerts about unrecognized logins, and enable your preferred login alerts. We highly recommend enabling email notifications.

(Click the screenshots to view them at full-size so you can follow the steps.)

How to Set Up Two-Factor Authentication

Facebook’s two-factor authentication How to Use 2FA on Facebook Without a Phone Number It's easy to set up 2FA on Facebook. And by using an authentication app, you don't even need to provide a phone number. Read More requires a mobile phone number or an authentication app. If you’d like to use a phone number for two-factor authentication, note that you can no longer use that same number to reset your password.


How to Add a Phone Number to Facebook

You can add a phone number while setting up two-factor authentication. If you’d like to make sure that you have a current phone number on record or add a second one before you start the process, here’s how to do it:

  1. Tap the hamburger menu in the Facebook mobile app
  2. Expand Settings & Privacy
  3. Navigate to Settings > Personal Information > Phone Number

You can add as many numbers as you like, and we highly recommend that you add at least two. Note that adding a number will automatically enable text notifications to the last-added number, something you might want to disable.

How to Enable Two-Factor Authentication on Facebook

To enable two-factor authentication, navigate to Settings > Security and Login > Use two-factor authentication, choose whether you want to use an Authentication App or Text Message (SMS), and follow the on-screen instructions to set up your choice.


2FA via Text Message (SMS)

When you tap this option, all you have to do is select the phone number you’d like Facebook to use. As mentioned above, you can also add a new phone number while setting up two-factor authentication.

After you finalize the setup, you can always go back and change the phone number. Each time you do that, you’ll have to enter a confirmation code sent to the new phone number.


2FA via Authentication App

When you choose to use a third-party authentication app, you can scan a QR code, set it up on the same device, or manually enter a code into the desired authentication app.

We went with the third-party app and it was all done in a matter of seconds. Note that when you return to Facebook, you’ll have to enter a confirmation code from the app to finalize the setup.

Always Set Up Backup Facebook Recovery Methods

After you’ve turned on two-factor authentication, be sure to keep your phone number(s) up to date and always have an authorized device as a backup to log in or change your settings. Most importantly, however, set up the following backup security methods:

  1. A phone number that can receive recovery codes via text message. This can be the same number you’ve already added, but you’ll have to confirm it as a backup method.
  2. An additional authentication app; on a separate device for example.
  3. Recovery codes that you can digitally or manually copy and store in a save place.

All of these methods are available under Settings > Security and Login > Use two-factor authentication. You can also go back to update or disable any of these methods.

How to Set Up Code Generator

While you can set up and access most features described above from Facebook in your browser, Code Generator is a feature exclusive to the Facebook mobile app. If you had the app installed all along, Code Generator should be available already.

When you first log into the Facebook mobile app and have already set up two-factor authentication, you will need a security code to complete your login. Inside the Facebook app, open the hamburger menu, scroll to the bottom, tap Code Generator, and Activate it. That’s it.

The next time you want to access Facebook on a new device and cannot receive a text message—for example, if you don’t have a signal or you switched SIM cards—you can use Code Generator instead. Simply open your Facebook app, tap the hamburger menu in the top-right, scroll down, tap Code Generator, and long-tap the code to copy it to your device’s clipboard.

Facebook Code Generator showing a security code that will expire in 30 seconds.

Should you ever lose access to Facebook Code Generator How to Log Into Facebook If You Lost Access to Code Generator Lost access to Facebook's code generator? This article covers alternative methods for logging into your Facebook account. Read More (for example, if your phone was stolen), you can log into Facebook from a recognized device, log out on your phone, and remove Code Generator. Until you get your phone back, you can also set up a third-party app to generate codes.

Keep Your Facebook Account Secure

Once you have straightened out your personal information, security settings, and backup recovery methods, you should never struggle to recover your Facebook account login. If you want to verify that you’ve sufficiently protected your Facebook account, try out Facebook’s Privacy Checkup tool and see if you can make any other improvements to keep your account secure.

If you’re concerned that your account was compromised, here’s how you can see who accessed your Facebook account How to Check if Someone Else Is Accessing Your Facebook Account It's both sinister and worrisome if is someone has access to your Facebook account without your knowledge. Here's how to know if you've been breached. Read More (or which devices) and kick them out if needed.

Related topics: Facebook, Online Security, Two-Factor Authentication.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Sushil Laxman more
    November 26, 2018 at 2:00 pm

    Hi, i am sushil. I using two step verification. Bt I completely lost my fb login access, due to my mobile number is lost, and forget my login code too, and unable to login fb, i also contact to fb bt he didnt give me rpy plz help me, what should i do

  2. usman cool
    July 12, 2018 at 11:30 am


  3. usman cool
    July 12, 2018 at 11:30 am

    what happen to my fb acoount showing a code but code cant get.. how to get a code for my phone....

  4. Joseph
    January 3, 2018 at 1:36 pm

    Who knows how to go about the error message "you have requested too many text message security codes recently. please try again later." It's a week since I started getting the error. I cannot receive any codes to login.

  5. Joseph
    January 3, 2018 at 1:34 pm

    I set up two-factor authentication but now cannot access my account. Every time I try to login am getting an error message "you have requested too many text message security codes recently. please try again later."

    It's now one week and I've been trying with no success. Can't receive the code, I don't understand why.

    Anyone ever solved this?

    • Irene
      June 3, 2019 at 8:24 pm

      I have similar problem. Have you been able to solve it ? If yes please help me with mine

  6. Mohd Hamza
    December 27, 2017 at 4:11 am

    I have switched on two factor verificartion. I am stuck in a problem now. when iam trying to log it it shows that "You have recently requested for two many security codes. Please try again later". Please tell me for how long will I have to wait. Its already been 3 days since i logged in to my account last. Please help.

  7. Kirti
    October 27, 2017 at 3:39 pm

    I m not able to login in facebook... I have a mobile no... But msg not receiveing pls help me

  8. Kirti
    October 27, 2017 at 3:37 pm

    I m not able to login in... Pls help me.... Login code message also not receiveing...

  9. Jon
    September 13, 2017 at 6:56 pm

    I enabled two step verification but my gf text back "stop " so now I can't get a code to log in. Is there a way to turn the codes by text back on??

    • Tina Sieber
      September 14, 2017 at 12:46 am

      I didn't know you could turn them off by texting "stop"!? What happens when you request a code through text?

  10. Jon
    September 13, 2017 at 6:49 pm

    I enabled two step authenticator and was receiving text messages on my phone but my gf replied "stop"to them and now they are not sending me codes. Is there a way to start it back up

  11. nazneen Tania
    July 1, 2017 at 6:22 am

    Mobile number destroyed ..recover my facebook account?? I can't log in

  12. Tausif.shabbir
    May 31, 2017 at 7:59 pm

    Actually, I done factory reset, due to viruses found, after completion of again install Android app so that time my phone can't access due to code generator symptoms , further I can't approval Kindly do the needful in this regards. With complete guidance.

    • Tina Sieber
      May 31, 2017 at 10:48 pm

      Either disable two-factor authentication on a computer where you can still access Facebook or try to recover the account in another way; see above. There's nothing else I can think of.

  13. syed saqlain haider
    May 17, 2017 at 4:22 pm

    please help me for open my account . i can't recive Approval code because my phone number lost :( please help me

    • Tina Sieber
      May 17, 2017 at 6:34 pm

      See comments below, Syed. Emailing might be your only hope. And it can take a long time to get a response.

  14. Sahood
    March 17, 2017 at 2:22 pm

    I dont receive aprovel code on my phone and email what should i do plz tell me.

    • Tina Sieber
      March 17, 2017 at 7:09 pm

      Is it possible that someone changed this information? Are you still using the same phone number? Did you check your email spam folder?

      If all else fails, report your account as hacked / compromised and hope that Facebook will be in touch to verify your identity. Good luck!

  15. Dexter Cruz
    November 20, 2016 at 3:12 pm

    Awesome giveaway!

    • Tina Sieber
      November 20, 2016 at 3:22 pm

      Wrong article, I'm afraid.

  16. JEP
    August 12, 2016 at 3:11 pm

    How do you change your phone number? I've been trying to figure it out.

  17. mati
    May 9, 2015 at 2:35 pm

    tere1 what to do with the code generator does not receive the sms code, and I can not get in way over with already looking forward to three days of this code, but it does not come to work? This code is always sent before, and now no longer corresponds to the code generator to get why the system is error ???

  18. Mohammad Shamshad Alam
    April 27, 2015 at 3:22 am

    i needs my code generator. kindly provide me .text me message and send to mail.
    thanks with regards

  19. vigneshwar
    March 28, 2015 at 3:52 pm

    Facebook can send only a limited number of text messages . that is not good..

  20. brian slaughter
    February 21, 2015 at 6:18 pm

    My wife tried to use my phone to login to facebook on my phone but wont let her no where to put codes tells her to usediffert web browser

    • sana
      November 17, 2015 at 9:21 am


  21. isha yadav
    January 12, 2015 at 7:27 am

    i am trying to log in to my Facebook a/c but they are asking for some code and that code is going to my lost phone number which i don't have now with me, i am trying to set my new phone number but can't understand from where should i change becoz i can't open my a/c to reset my new number. plz help me

  22. nada
    November 7, 2012 at 10:40 am

    i didn't get my Security Code

    • Tina
      November 7, 2012 at 3:43 pm

      It can take some times for the code to get through. There shouldn't be a large delay, but the other day I had to wait for several hours. If you haven't received it after 24 hours though, something is definitely wrong.

  23. josephg1213
    October 20, 2012 at 8:33 am

    login approval sms message is not going through , i checked with the mobile service provider and they said all is ok on their part , last sms message i received was 14 hrs after i logged in , so its already spoiled and useless as i have logged out , in boredom of waiting. after that its been more than 24 hours and still no code was sent, has anyone SUFFERED same fate as with me? , i dont think its the mobile carriers fault... my hunch is theres a system glitch or problem with FB messaging system.. i hope its temporary , first chance i get i will activate this code generator

    • Tina
      October 20, 2012 at 8:53 am


      Hope it was just a glitch. I heard that it took a few hours for an SMS to get through for some people, but it should not take longer than the code is valid for. Never took longer than a few minutes for me.

      Are you trying to set up the Login Approvals Code Generator for Android? With that you can create the codes yourself on the go and wouldn't have to wait for a text message. Worth a thought for the future.

      • josephg1213
        October 20, 2012 at 2:25 pm

        after waiting for long hours like that , i MUST set up this generator :)

  24. Completely Frustrated
    September 27, 2012 at 1:51 pm

    Keep getting the "Your current Firefox settings might make it hard to use login approvals." error.

    Gmail was easy to initiate this as was twitter but Facebook is a complete fail. Checked all settings, cookies not being erased, all other issues Facebook says cause it are taken care of and still the same stupid notice that blocks progress. Also I have tried to do this from 3 computers, my phone, and ipad and still the same stupid notice. After 2 weeks its just ridiculous.
    I am in a country where hacking of facebook is a serious issue and want this feature, but is Facebook really so Big Brother that they want to prevent me from using the security because they think it might "make it hard". Just let me use it you idiots and I will worry about the difficulties. Sheesh.

    Does anyone, please know a way to bypass the "helpfulness" of the morons at Facebook and actually enable this Login Approval feature?

    • Nexen4
      October 7, 2012 at 6:12 am

      I don't use an iPhone or an android device? What do I do :/ Can this work with my Nokia 3310?

      • Tina
        October 7, 2012 at 9:30 pm

        Is there a Facebook app for this device? If not, then it's impossible.

    • josephg1213
      October 20, 2012 at 2:33 pm

      i had the same issues as with you before , and it took me 3 days to set up this login approval .... try to use google chrome browser but you have to be logged in (google) when you set up your FB login approval ...

  25. Bandhan Shariar
    September 23, 2012 at 10:54 am

    I set up login approvals in my facebook id.I also make my computer recognize..But a few days ago i set up my computer.So after finishing my setup i am going to log in to facebook.But they now want security codes..Well thats good..But the codes didn't coming to my phone yet...So what i have to do now??..I have already tried severel times ...But the codes didn't coming in my phone..Please suggest something...My facebook id is so expensive for me.....So i request u to suggest me something for recover my facebook id...

    • Tina
      September 23, 2012 at 3:27 pm

      You had to use a code sent to your phone when you set up login approvals. Did that work? If yes, then login approvals are enabled. If no, you can probably still disable it if you manage to get into your profile on a recognized device.

      In any case, try a computer and browser where your Facebook login information is stored. It shouldn't require a security code there and you may be able to fix or turn off login approvals.

      If that doesn't work, try to recover your account following the options Facebook gives you. There must be an option for not having access to the security phone number.

      • Bandhan Shariar
        September 23, 2012 at 5:08 pm

        actually i recognize mine laptop for facebook login approvals..But a few days ago i setup my laptop and for that's why i have no information for my facebook id in my laptop.And then i setup a new browser.Then i tried to log in in my facebook id..Then told me that a security code was sent to my phone..But i didn't get any code yet.I tried many times but i was failed.I don't find anyway to recover my id...Please tell me ..My account is too much expensive for me..There's a lot of celebrity of BANGLADESH..who are friend with me in facebook.Between I run three facebook Pages..And two groups..Hope you understand how impotant my account is!...If u help me in this I really so thankfull to you...

  26. bharatsingh
    September 17, 2012 at 10:32 am

    i wants to open account our hotel jaipur heritage but some problem like so pl.
    help me how can i open my account.


  27. kelly w
    September 1, 2012 at 5:50 pm

    I was trying to set this up today for my iPhone (as offered on Facebook). But now I'm in limbo, because, mid-setup, the code generator isn't showing up on my iPhone. Any suggestions?

    • kelly w
      September 1, 2012 at 5:54 pm

      ooh! I had to update iPhone. working now. :]

  28. kalleya marut
    August 30, 2012 at 6:38 am

    I have been trying Loging my Facebook id from past 5 days, but, I couldn,t get through it. They Just Show me that your Acccount has been Temporarily Locked. I even tried to reset my Facebook Password but was of no use.
    Suggest me the solutions to Unlock My Facebook Account.

  29. Evelyn Randall
    August 9, 2012 at 12:03 am

    I have been hacked with unsightly pron. pictures that was sent to all my friends.

  30. Thegreatvinay
    June 5, 2012 at 6:51 pm

    explained in a great way with screenshots !!

  31. Kyem Ghosh
    June 5, 2012 at 5:27 pm

    even google account is having this kind of secure login... But it is much easier in facebook cz the text msg reaches very fast, within a few seconds of the click. But google takes a bit long time....

    • Andri Agassi
      June 6, 2012 at 8:14 am

      My experience is the exact opposite, I received Facebook SMS in a day, as with Google it's only 1-2 seconds.

      • Tina
        June 6, 2012 at 11:48 am

        Might have to do with the provider through which the notifications are sent. I haven't tried Google, but Facebook arrives in seconds.

    • dfgdf
      February 28, 2015 at 9:47 pm

      in my case both arrived in 5 to 10 sec