Tools / 2FA codes

2FA Code Generator (TOTP)

Paste your two-factor authentication secret key and see the current code, just like in Google Authenticator. The key never leaves your browser.

The code is calculated in your browser using the TOTP standard (RFC 6238) — the key is never sent or stored. For banking and your main email it's safer to keep the key in an authenticator app on your phone.

Many accounts?

A separate SMS number and a separate IP for every profile — NOMEROK virtual numbers and residential proxies.

Proxies for accounts →

This 2FA code generator calculates the one-time two-factor authentication code from your secret key, exactly as Google Authenticator or any other authenticator app does. Paste the key or an otpauth:// link into the field above and you’ll immediately see the current code, a bar showing the seconds left, and the next code. Everything is calculated in your browser using the TOTP standard; the key isn’t sent anywhere or stored.

Below we explain what 2FA and TOTP are in plain English, where to find your secret key, when an online generator makes sense and when an app on your phone is the better choice, why a code might be rejected, and how not to get locked out of your accounts if you lose your phone.

How to get a 2FA code from a secret key

From key to code
  1. 1Keyfrom the service’s 2FA settings
  2. 2Pasteinto the field at the top of the page
  3. 3Codeappears instantly, refreshes every 30 s
  4. 4Copywith one click on the code
  1. Copy the secret key — a string like JBSW Y3DP EHPK 3PXP that the service shows next to the QR code when you set up 2FA — or the full otpauth:// link.
  2. Paste it into the field above. Spaces, hyphens and lowercase letters are fine. The code appears straight away; there’s no button to press.
  3. Click the code to copy it and paste it on the site before the bar runs out.

What the generator shows

  • The current code — usually 6 digits.
  • A timer — how many seconds the code is still valid.
  • The next code — so you don’t have to wait if there are only 2–3 seconds left.
  • The account name, if you pasted an otpauth:// link that includes a label.

otpauth:// links

If the link specifies non-standard settings — 8 digits instead of 6, a 60-second period instead of 30, or the SHA-256 or SHA-512 algorithm — the generator applies them automatically. Just paste the whole link.

What is 2FA (two-factor authentication)?

Two-factor methods compared
SMS codeTOTP codePasskey / security key
Needs mobile signal✓✕✕
Works offlineneeds signal✓✓
Vulnerable to SIM swap✓✕✕
Can be entered on a phishing site✓✓✕
Supported by servicesalmost allmostmore and more
Recovery if you lose your phonevia your carrierbackup codes or keybackup key

2FA, or two-factor authentication, means signing in with two independent things. The first is something you know: your password. The second is something you have — a phone with an authenticator app, a SIM card, a security key — or something you are, like a fingerprint. Even if your password is stolen, nobody can sign in without the second factor. You’ll also see it called two-step verification or multi-factor authentication (MFA).

Types of second factor

Not all methods are equally secure. The most common balance between convenience and protection is a code from an authenticator app (TOTP), which is exactly what this generator calculates. Passkeys and hardware security keys go further, because they can’t be used on a phishing site.

What is TOTP and how is the code calculated?

A TOTP code changes every 30 seconds (example)
  1. 00:00code 492 039
  2. 00:30code 815 274
  3. 01:00code 306 118
  4. 01:30code 627 950

TOTP (Time-based One-Time Password) is an open standard, RFC 6238. It’s used by Google Authenticator, Microsoft Authenticator, password managers and almost every site that offers codes “from an app”. Because it’s a standard, a key from any website works in any authenticator.

How it works

  1. When you turn on 2FA, the service and your authenticator receive the same secret key.
  2. The current time is divided into 30-second intervals, giving an interval number.
  3. An HMAC cryptographic signature is calculated from the key and the interval number (with SHA-1 by default).
  4. A number is extracted from the signature and cut down to 6 digits. That’s your code.

The server performs the same calculation and compares the result. Nothing is transmitted in advance, so the authenticator doesn’t need an internet connection, just the correct time.

ParameterDefaultOther options
Digits68
Period30 seconds60 seconds
AlgorithmSHA-1SHA-256, SHA-512
Key formatBase32: letters A–Z and digits 2–7—

Where to find your 2FA secret key

The secret key is shown only once, when you turn on two-factor authentication. Afterwards most services don’t let you view it again in the settings.

  • On the screen with the QR code, look for a link such as “Can’t scan it?”, “Enter a setup key” or “Show key”.
  • The key is 16–32 characters of Latin letters and the digits 2–7, often split into groups of four.
  • The QR code itself contains a link like otpauth://totp/Service:login?secret=KEY&issuer=Service. If you have that link, paste the whole thing.

If you don’t have the key

If 2FA is already on and you didn’t save the key, go to the service’s security settings, remove the authenticator and add it again. You’ll get a new key, and the old one will stop working.

The digits 0, 1, 8 and 9 never appear in a Base32 key. If you’re copying a key by hand and see a “0” or “1”, it’s almost certainly the letter O or I.

When an online 2FA generator makes sense, and when it doesn’t

Good uses

  • Checking a key before you rely on it. After setting up 2FA, compare the code in your app with the code here to make sure the key was saved correctly.
  • No phone to hand, but the key is stored in your password manager on your computer.
  • Work and test accounts whose keys are kept with other credentials, for example in a team that manages client social media pages.
  • Moving to a new authenticator: confirming that keys exported from the old app produce the right codes.

Not a good idea

  • For your main email, bank, crypto wallet or government accounts (such as GOV.UK One Login or Login.gov). For these, the key should live in one protected place: an app on your phone or a hardware key.
  • On someone else’s, a work or a public computer.
  • As a permanent replacement for an authenticator: if the key sits next to the password in the same note, your two factors effectively become one.

Security: what happens to your key on this page

The code is calculated by Web Crypto, the cryptography module built into your browser. The page doesn’t send the key to a server and doesn’t save it in cookies or browser storage. When you close the tab or clear the field, the key is gone.

What could still see the key

  • Browser extensions with access to all websites. For working with keys, use a browser profile without unnecessary extensions.
  • The clipboard, especially if your phone keyboard keeps a clipboard history or syncs it between devices.
  • A compromised device with malware. No generator can help with that.

Where to keep keys

Safely: in a password manager with TOTP support (Bitwarden, 1Password, KeePassXC and others can show codes) or in an authenticator app with an encrypted backup. For your most important accounts, keep 2FA separate from the password: the password in your manager, the codes in an authenticator on your phone.

2FA code not working: causes and fixes

CauseFix
Wrong time on your computer or phoneTurn on automatic date and time in your system settings. Even a 30–60 second difference produces the wrong code.
The code expired while you were typingWait for the new code, or use the next one if only a few seconds are left.
A mistake in the keyCopy the key again. If typing it by hand, check O/0 and I/1: keys only contain the letters.
Non-standard settings (8 digits, 60 s, SHA-256)Paste the full otpauth:// link so the generator can read the settings.
The key has been replacedIf 2FA was reset, the old key no longer works. You need the new one.
Too many failed attemptsThe service may have temporarily locked sign-in. Wait and try again with the correct time.

What the generator doesn’t support

  • HOTP — counter-based rather than time-based codes (otpauth://hotp/… links). The generator only calculates TOTP.
  • Steam Guard — uses its own letter-based code format.
  • Push approvals (“Is this you signing in? Yes/No”) and SMS codes — these aren’t derived from a key.

Google Authenticator, Microsoft Authenticator and password managers

All popular authenticators use the same TOTP standard for third-party sites. So the code our generator shows for a given key matches the code in your app, which is a handy way to check that the key is right.

AppNotes
Google AuthenticatorSimple; can sync codes to your Google Account and export accounts via QR code to move them to a new phone.
Microsoft AuthenticatorStandard TOTP codes for third-party sites; push approvals for Microsoft accounts.
Password managers with TOTPThe code sits next to the password with autofill. Convenient, but the password and the second factor end up in the same vault.
Hardware security keysSome models can store TOTP keys and show codes through a companion app; the strongest protection against key theft.

Moving codes to a new phone

Before you reset or sell your old phone, transfer your accounts using the app’s export feature or turn on sync. Save backup codes for every important service: if the transfer fails, they let you sign in and set up 2FA again.

Backup codes and account recovery

Just turned on 2FA? Check that
  • The service accepted the code from your app
  • Backup codes are saved somewhere other than your phone
  • The key is correct (code here = code in the app)
  • Recovery email and phone on your profile are current
  • Your device sets the time automatically

The most common 2FA problem isn’t hacking, it’s a lost phone. Sort out a backup way in before you need it.

  • Backup codes. Almost every service offers 8–10 single-use codes when you enable 2FA. Store them in your password manager, or print them and keep them with your important documents.
  • A second sign-in method. Add a backup authenticator or a passkey on another device.
  • Up-to-date recovery details. The recovery email and phone number on your profile should be yours and working. A temporary email won’t do: those inboxes disappear.
  • An encrypted copy of your keys. If you keep secret keys, keep them only in a password manager or an encrypted file, never in plain notes.

2FA for work accounts and multiple profiles

Social media managers, agencies and support teams often look after dozens of client accounts. Each one gets 2FA, and the keys are stored in a shared team password manager. That’s where an online generator helps: getting a code quickly when the right phone isn’t nearby.

What else is worth separating

  • Phone number. If a service asks for an SMS at sign-in, a separate number per work account keeps things tidy. For a one-off confirmation, a number for receiving SMS will do; for regular logins, rent a number for anything from a day to several months. Services and countries are in the catalog.
  • IP address. Services link sign-ins to different accounts from the same address. Separate profiles typically use proxies, and What is my IP shows what websites see about your connection.
  • Password. A different one for each account, from our password generator.
Only manage accounts you have the right to manage, and follow each platform’s rules. A virtual number is no substitute for identity verification where it’s required.

FAQ

What is 2FA in simple terms?
Signing in in two steps: first your password, then a code or approval from a device only you have. If someone steals your password, they still can’t get into the account without the second step.
What is TOTP?
Time-based One-Time Password, the RFC 6238 standard for one-time codes that change over time, usually every 30 seconds. The code is calculated from a secret key and the current time, so the app and the server arrive at the same code without sending it over the internet.
Is it safe to enter my 2FA key on this site?
The key isn’t sent to a server or stored: the code is calculated in your browser. Even so, for email, banking and crypto wallets it’s safer to keep the key only in an authenticator app on your phone and not enter it on any website.
Where do I find my 2FA secret key?
It’s shown when you turn on two-factor authentication: next to the QR code there’s a link like “Enter a setup key” or “Can’t scan it?”. If you didn’t save it, remove and re-add the authenticator in the service’s settings to get a new key.
Why is my 2FA code not working?
Most often because the time on your device is off: turn on automatic date and time. Other causes are a typo in the key, an expired code, non-standard settings (paste the full otpauth:// link) or a key that has since been replaced.
Are the codes the same as in Google Authenticator?
Yes, if the key is the same. Google Authenticator, Microsoft Authenticator and password managers all use the TOTP standard, so for one key at one moment they all show the same code.
Are 8-digit codes or a 60-second period supported?
Yes, if those settings are in the otpauth:// link. Paste the whole link and the generator will apply the number of digits, the period and the SHA-1, SHA-256 or SHA-512 algorithm. HOTP and Steam Guard codes aren’t supported.
I lost the phone with my authenticator. What now?
Sign in with the backup codes the service gave you when you enabled 2FA, then set up the authenticator on your new phone. Without backup codes, use the service’s account recovery process, which takes longer and usually requires proving your identity.
Which is more secure: SMS or an authenticator app?
An authenticator app. SMS codes can be intercepted through a SIM swap, while TOTP codes are calculated on your device without the network. Passkeys and hardware security keys are stronger still, because they won’t work on a phishing site.