How to get 2FA codes from a secret key (no phone needed)

You turned on two-factor authentication (2FA) for Facebook, Google or an exchange — then your phone broke, got replaced, or the Authenticator app was deleted. Don't panic: if you saved the secret key when you set 2FA up (a string of characters like JBSWY3DPEHPK3PXP, sometimes called a setup key), you can still generate valid 6-digit login codes right in your browser, no phone required.

What is a secret key, and how is it different from the 6-digit code?

The 6-digit code you type at login (a TOTP code) is computed from the secret key combined with the current time, and it changes every 30 seconds. The secret key is the fixed "seed": anyone who has it can produce correct codes anywhere, without the original account. That is why services tell you to store it carefully during setup — and why you must never share it with anyone.

During 2FA setup, the secret key usually appears on the "can't scan the QR code?" screen as a string of uppercase letters and digits. If you saved that string in your notes, a password manager or on paper, that is exactly what this guide uses.

Steps: generate a code from your secret key

  1. Open the 2FA Authenticator tool on Tools TEKVN.
  2. Paste your secret key into the input box. For several accounts, paste one key per line — the tool handles many lines at once.
  3. Click GET CODE. Each line produces a 6-digit code with its remaining validity time.
  4. Click a code to copy it, then paste it into the service's verification box. Work quickly while plenty of seconds remain; if the window is about to roll over, wait for the fresh code.
Tip: Codes refresh automatically every 30 seconds. If a line reports "Invalid key", that string is not a valid secret key — check for stray spaces, missing characters, or a mix-up with a recovery code. Recovery codes are a different thing and cannot be used here.

Why is my generated code being rejected?

1. Clock drift

TOTP codes depend entirely on time: drift more than about 30 seconds and the code will not match the server. The tool on this page syncs against server time to reduce that risk; in other apps, enable "set time automatically" on your device.

2. The key belongs to a different account

Every account has its own secret key. A code generated from account B's key will never work for account A, even when generated perfectly.

3. 2FA was reset on the service

If you (or an admin) turned 2FA off and on again, the old secret key was revoked and a new one issued. Only the new key works.

Safety rules for generating 2FA codes on the web

Try it now: open the 2FA Authenticator tool, paste your secret key and get your code — free, no account needed.

Related guides: How to look up a domain's Whois record · How to find all subdomains of a website