X 2FA methods
X supports several two-factor authentication methods, such as an authentication app, a security key and, for some accounts, text messages. X has limited text-message 2FA in recent years, so an authentication app is usually the most practical choice for most people. It works with any standard TOTP authenticator.
How to turn on 2FA on X (Twitter)
- Open X and go to Settings and privacy.
- Open Security and account access, then Security.
- Choose Two-factor authentication.
- Select Authentication app and confirm your password.
- X shows a QR code. Look for an option to show the key as text if you cannot scan it, and save the key.
- Enter the 6-digit code from your authenticator to finish, then save the backup code X shows.
Menu names can change over time. If a step looks different, search the service's official help pages for "two-factor authentication".
Get your X 2FA code in the browser
- Open the 2FA code generator in a new tab.
- Paste the X key into the box, or click Scan QR or the upload button to read the QR code.
- Your 6-digit X 2FA code appears instantly, with a countdown to the next code.
- Copy the code and enter it in X before the timer runs out.
This is useful for social media managers who post from a computer, as long as the key is kept private and the browser is not shared.
Your X backup code
X provides a backup code when you turn on two-factor authentication, and you can view it again in the two-factor authentication settings while logged in. Store it offline. It lets you log in if you lose access to your authenticator.
If you are locked out without a backup code, use X's official login help. Our guide on recovering a 2FA account covers the general steps.
Third-party apps and several devices
X asks for your 2FA code when you log in on a new device or browser. Apps you connected to your account earlier, such as scheduling tools, usually keep working because they were authorised separately. If you manage several accounts, give each one its own saved entry in your authenticator with a clear name, so you never enter a code for the wrong account. Review active sessions in your security settings from time to time and log out of devices you do not use.
Protect your X account from takeovers
- Beware of DMs about "account suspension", "verification" or "copyright" that ask you to log in through a link.
- Review connected apps in your settings and remove any you do not recognise.
- Never share your login code with anyone, including people claiming to work for X.
Our 2FA code generator is an independent tool and is not affiliated with X Corp. or Twitter.
Frequently asked questions
How do I get my Twitter (X) 2FA code?
Open the authentication app you linked to X, or paste the same X key into our 2FA code generator to see the current 6-digit code.
Where is two-factor authentication on X?
It is under Settings and privacy, then Security and account access, then Security. Menu names can change over time.
Do I need X Premium for 2FA?
No. An authentication app and security keys can be used without a subscription. Text-message 2FA has been limited, which is why an authentication app is recommended.