Free · Key stays in your browser

2FA code generator: get authenticator codes from your secret key

If your phone is not at hand or you are moving your authenticator to a new device, paste the secret key (Base32) or the otpauth:// link you got when setting up 2FA and see the code that refreshes every 30 seconds. Everything is computed in your browser: the key is never sent to our server and is not stored anywhere.

The key is kept only in this tab's memory: it is not sent to a server or saved. It is gone when you close the tab.

Need an SMS verification instead?

For a service that asks for a one-time SMS code at sign-up, you can get a number without sharing your personal one. Pick a service to see the live price:

How to use it

  1. On the service's 2FA setup screen, use the "can't scan the code / enter key manually" link under the QR code to reveal and copy the secret key.
  2. Paste the key or the full otpauth://totp/... link into the box. Spaces and letter case do not matter.
  3. If the service specifies other settings, choose the algorithm (SHA-1/256/512), digits (6/8) and period (30/60 s). Most services use SHA-1, 6 digits and 30 seconds.
  4. Enter the code before the timer runs out. If it is rejected, first check that your device clock is set automatically; press Clear when you are done.

What are 2FA and TOTP?

Two-factor authentication (2FA) asks for a second proof that only you have, on top of your password. Its most common form is TOTP (RFC 6238): the service and your authenticator app share the same secret key, both split the current time into 30-second steps, compute an HMAC with the key and arrive at the same 6-digit code. The code is generated without an internet connection.

That is why TOTP has two requirements: the key must be correct and the device clock must be correct. If the clock is off by a few minutes, the code falls outside the time step the service expects and you get an "invalid code" error.

How do authenticator apps work?

Apps such as Google Authenticator or Microsoft Authenticator store the otpauth:// link inside the QR code you scan during setup. The link holds the secret key (secret), the service name (issuer) and, if needed, algorithm, digit and period settings. This tool does the same calculation, so with the right key it produces the same code.

The secret key is your account's second key. Anyone who knows it can generate your codes. Do not leave it as a screenshot in your gallery or as a plain note; keep it in a password manager or a safe offline place and never share it.

Moving 2FA to a new phone and backup codes

SMS 2FA or app-based 2FA?

An SMS verification code is better than no 2FA at all, but it is exposed to SIM swap attacks and carrier delays. For accounts you will use for a long time, an authenticator app is the more resilient permanent second step.

A one-time virtual number is for completing a sign-up or a single SMS verification without sharing your personal number. These numbers may later be given to someone else, so do not make a temporary number your account's recovery number or permanent 2FA number. If you need a number for days, see the rental number option.

Frequently asked questions

Is this 2FA code generator safe?

Codes are computed in your browser with Web Crypto; the secret key is not sent to our server and not written to cookies or browser storage. Still, do not enter a key on a shared or untrusted device, and press Clear when you are done.

Why is the generated code rejected?

The most common cause is a drifting device clock; switch time to automatic. Then check that the key was copied completely and that the algorithm, digits and period match what the service expects. Also enter the code before the timer runs out.

Where do I find the secret key?

During 2FA setup there is a link such as "enter key manually" under the QR code; the key is shown there. Most services do not show it again after setup, so save it somewhere safe at that moment.

I lost my phone. How do I get my 2FA code?

If you saved the secret key, you can generate a code with this tool; otherwise use one of the backup codes from setup. If you have neither, follow the service's account recovery process; this tool cannot generate codes without the key.

Is SMS 2FA or app 2FA better?

An authenticator app is more resilient: the code is generated on your device and is not affected by SIM swap attacks or SMS delays. If you use SMS 2FA, do it with your own permanent number.

Can I use a virtual number for 2FA?

A one-time number is for a single verification and may later be given to someone else, so do not use it as a permanent 2FA or recovery number. If you need a number for a few days, choose a rental number; for a permanent second step, use an authenticator app.

Get SMS verification codes without sharing your own number

Turonay offers virtual numbers for 200+ countries and 200+ services; you see the price and stock before you buy. If no code arrives, the fee goes back to your balance.

More free tools