What is 2FA authentication (two-factor authentication)?
2FA authentication, short for two-factor authentication (you will also see it written as 2 factor authentication), puts a second check on top of your password. Even if someone learns your password, they still can't sign in without the second factor: a short one-time code that only you can produce.
Most websites use time-based one-time passwords (TOTP), and a TOTP generator like this page creates them from your secret key. Your account and your authenticator share a secret key. Every 30 seconds, both sides mix that key with the current time and land on the same 6-digit code. Think of each code as a temporary 2FA token: it proves you hold the key, then expires, so a stolen code is useless a moment later.
These 2FA codes can come from an app on your phone or from 2FA online tools like this page. Either way the maths is the same, so the codes match.

How to get your 2FA authenticator code in 4 steps
- Open your account's security settings, turn on two-factor authentication and choose "authenticator app".
- When the QR code appears, pick "Can't scan?" or "Enter key manually" to reveal the text secret key.
- Paste that key above, or scan the QR code, or upload a screenshot of it.
- Copy the 6-digit code and enter it before the timer runs out to finish your 2FA login.
The same steps work for Google, Facebook, GitHub, Discord and any service that supports standard authenticator apps. Managing several accounts? Save each one with a name so your 2FA codes are always one click away.

Is 2FA auth safe? What happens to your key
Codes are calculated in your browser with the Web Crypto API, and your secret key is not sent to any server. If you choose Save Account, the key is kept in this browser's local storage as plain text, so only do that on a device you trust and never on a shared computer.
Treat a secret key like a password: anyone who has it can generate your codes. Use the tool only for your own accounts, and keep your backup codes and keys somewhere safe, such as a password manager.
How to Set Up a 2FA Authenticator
To set up an authenticator, open the security settings for the account you want to protect and enable two-factor authentication. Choose an authenticator app or authentication method when the service offers it. The service will usually display a QR code and may also provide a setup key for manual entry.
- Keep the setup screen open and choose the option to scan a QR code or enter the setup key manually.
- Add the QR code or secret key to an authenticator that supports time-based one-time passwords (TOTP).
- Use the authenticator to generate a verification code, then enter that code on the service's setup screen.
- Save any recovery or backup codes provided by the service in a secure place separate from the device you use to authenticate.
Only finish setup after the service confirms that the code is valid. Keep the secret key private: anyone who obtains it may be able to generate codes for that account.
How to Fix Invalid or Incorrect 2FA Codes
If a website rejects your authenticator code, check the following before trying again:
- Check your device time. Enable automatic date, time and time-zone settings on the device generating the code. TOTP codes depend on the current time.
- Wait for a fresh code. If the current code is about to change, wait for the next one and enter it before it expires.
- Verify the secret key. Make sure you entered the setup key for the correct account and did not omit or mistype any characters.
- Check the account and method. Confirm that the service is expecting an authenticator-app code, rather than an SMS code, email code or another verification method.
- Set up the authenticator again if needed. If the saved key is incorrect or the service's setup was restarted, follow that service's official instructions to configure it again.
Repeated failures can trigger temporary security limits. If the code still does not work, use the service's official account-recovery process rather than sharing your secret key with someone offering help.
What Happens If You Lose Your 2FA Secret Key?
A secret key lets an authenticator generate codes for a specific account, but it is not the same as a recovery code. If you lose the key and still have access to the account, open the account's official security settings and follow its instructions to replace or reset the authenticator method. You may need to verify your identity first.
- If you saved backup codes: use one according to the account provider's instructions, then review your security settings.
- If you are still signed in: check whether the service lets you add a new authenticator or regenerate the setup key.
- If you are locked out: use the provider's official account-recovery process. A third-party code generator cannot recover a lost secret key or bypass the provider's security checks.
- For future protection: store recovery codes and any secret key you intentionally retain in a secure password manager or another protected location.
Never send your secret key or backup codes to another person. If you think someone else has obtained your key, use the account provider's official security settings to replace the authenticator setup as soon as possible.
About this guide and how it is kept accurate
This website (2faauth.us) is an independent project that offers a free, browser-based TOTP generator. Its codes follow the open standard RFC 6238 (built on RFC 4226), and the generator has been checked against the test values published in that specification.
This guide was last reviewed in October 2026. Setup steps for services such as Google and Facebook can change, so check the service's own help page if a menu looks different. We are not affiliated with Google, Meta, Microsoft or Authy. Found a mistake? Write to [email protected].