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
- Open the 2FA Authenticator tool on Tools TEKVN.
- Paste your secret key into the input box. For several accounts, paste one key per line — the tool handles many lines at once.
- Click GET CODE. Each line produces a 6-digit code with its remaining validity time.
- 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.
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
- A secret key is as sensitive as a password. Only enter it on a page you trust and understand.
- Prefer tools that compute in your browser. The Tools TEKVN 2FA tool calculates codes entirely on your device — the secret key is never sent to a server; the only server call fetches the correct time (see the Privacy Policy).
- Don't store secret keys in shared places such as shared notes or unencrypted cloud screenshots. A password manager, or paper kept somewhere safe, is a better home.
- Once you're back in, set 2FA up properly again: scan the QR code into an Authenticator app on your new phone and store the secret key and recovery codes in two separate places.
Related guides: How to look up a domain's Whois record · How to find all subdomains of a website