How to Set Up Two-Factor Authentication on X and Save Your Backup Code
Set up an authenticator app for X without relying on paid SMS verification. Save your backup code, test your login, and switch phones without losing access.
ok589 Editorial Team4 min read

1. Keep your current session open
- Start in a browser or the X app where you’re already signed in. Don’t sign out. Make sure you know your password and can access the email address linked to your account. X may ask you to re-enter your password or verify your email before you can enable two-factor authentication (2FA).
- Install an authenticator app that generates time-based codes from your phone’s official app store. Set your phone’s date and time to automatic; an incorrect clock can cause X to reject a valid code. Choose Authentication app, not Text message. This method doesn’t require paid SMS verification.

2. Connect your authenticator app to X
- On the web, click More in the sidebar. On mobile, tap your profile picture to open the menu. Go to Settings and privacy → Security and account access → Security → Two-factor authentication. If the labels have changed, search for “two-factor authentication” in the X Help Center.
- Select Authentication app and follow the prompts. In your authenticator, add an account and scan the QR code shown by X. If you’re setting this up on the same phone, use the option to open your authenticator if X offers it. If X shows a setup key, choose manual entry in the authenticator, enter the key, and select the time-based option.
- Label the entry with your X username so you can tell personal and store accounts apart. Return to X, enter the current code for that username, and confirm. Setup is complete only when X confirms it—not when the first code appears in the app.

3. Save your backup code and test your login
- On the confirmation screen, select Get backup code. If you’ve closed that screen, return to Two-factor authentication and look for Backup code. Check each character, label the code with your username, and save it in an encrypted password manager or write it on paper and lock it away. Make sure you can retrieve it without your phone. A screenshot stored only on that phone won’t help if it’s lost.
- Keep the three credentials distinct: an authenticator code refreshes automatically; a backup code works for one login when you can’t use the authenticator; the setup key can generate new authenticator codes. Don’t share the QR code, setup key, or backup code with support staff or coworkers. Don’t paste a real setup key into a web tool. See the 2FA tool guide for the difference between a setup key and a rotating code.
- Leave your original session open. Open a private browser window and sign in to X with your password and the current authenticator code. Once you’re in, sign out of the test session only. There’s no need to use your backup code for this test.

4. Troubleshoot login and phone changes
| Problem | What to do |
|---|---|
| X keeps rejecting the authenticator code | Check that the entry matches your X username and that your phone’s time is set to automatic. Wait for a fresh code, then enter it. Don’t try codes from other accounts. |
| The X entry is missing on your new phone | If you still have the old phone, use the authenticator’s built-in transfer feature. Test a login with a code from the new phone before erasing the old one. |
| You lost your phone and X asks for a code | At the verification step, choose another verification method and enter your saved backup code. Once signed in, connect your new authenticator and save a new backup code. |
| You can’t sign in and have no backup code | Check whether you’re still signed in on a device where you can manage security settings. If not, look for account access support in the X Help Center. Resetting your password doesn’t replace the second verification step. |

5. Before you close settings
- Confirm that Authentication app is enabled and that you’ve signed in with an authenticator code in a separate window.
- Make sure you can retrieve your backup code without the original phone. If you use the code or generate a replacement, save the new code and destroy old copies.
- If SMS verification was already enabled and you no longer want to use it, turn off Text message only after testing the authenticator and saving your backup code. Leave Authentication app enabled.