2FA Authenticator
Paste a 2FA secret key (e.g. from Facebook, Google or GitHub setup) or otpauth:// URI to get the current 6-digit TOTP code. Runs in your browser.
Still loading. If the tool doesn’t appear, reload this page.
About this tool
2FA Authenticator
Generate secure TOTP two-factor authentication codes in your browser. 100% client-side, works offline, RFC 6238 compatible.
A 2FA code generator turns the secret key a site shows during authenticator setup, a Base32 string such as JBSW Y3DP EHPK 3PXP, into the same 6-digit code Google Authenticator would show, refreshed every 30 seconds. Paste the key, an otpauth:// URI or a QR code image and press Generate Code. The secret is not sent anywhere.
How to use 2FA Authenticator
On the Enter Secret Key tab, paste your seed into the Secret Key (Base32) field — the hint under it reads Format: 16–32 character Base32 key (letters A–Z, digits 2–7), and the eye icon reveals what you typed. Or switch to the Scan QR Code tab and press Upload QR code image to pick any image file: it is decoded on your device and an otpauth:// URI fills in the secret, the Account Name and the algorithm, digits and period for you.
Optionally open Advanced Options to set Algorithm, Digits and Period, then click Generate Code. The code appears under Your Authentication Code with a ring counting down the Seconds remaining in the current window; an unusable seed shows Enter a valid Base32 secret key (letters A-Z and digits 2-7). in place of the digits.
Press Copy Code — it reads Copied! for a moment, and the clipboard is overwritten again 30 seconds later. The + button beside Saved Accounts stores the secret in the encrypted vault and confirms with Account saved & encrypted, clearing the entered secret; every code generated is also listed with its timestamp under Recent Codes.
Why use 2FA Authenticator
Full RFC 6238 parameter set
Switch between SHA1, SHA256 and SHA512, 6 or 8 digits, and 15, 30, 45 or 60-second periods.
Encrypted vault, not plaintext storage
Saved secrets are AES-256-GCM encrypted behind either a non-extractable device key or a PBKDF2-SHA256 passphrase key at 600,000 iterations.
Reads otpauth:// URIs directly
Paste the URI behind a setup QR code and the issuer, account label, algorithm, digit count and period are filled in for you.
Common use cases
- You are setting up 2FA on a laptop and the QR code is on the same screen — paste the otpauth:// URI or the secret shown under it and get the code without reaching for your phone
- Your phone is lost or wiped and you still have the backup secret written down, so you need a working code to get back into the account and re-enrol a device
- You are building a login flow and want to check that your server's TOTP validation accepts codes generated with 8 digits, a 60-second period or SHA-256 instead of the defaults
Frequently asked questions
How do I get a Facebook 2FA code from a secret key?
When you turn on two-factor authentication with an authentication app, Facebook (like most sites) shows a QR code and a text key. Paste that key into Secret Key (Base32), press Generate Code and type the 6-digit code into Facebook before the countdown ends. Keep the key private: anyone who has it can generate valid codes for that account.
Link to answerWill the code match Google Authenticator or Authy?
Yes, if they use the same secret, the same settings (most sites use SHA1, 6 digits and a 30-second period) and both devices have the correct time. Standard TOTP has no server step, so any correct implementation produces the same code for the same 30-second window.
Link to answerWhat if someone else has my 2FA secret key?
They can generate valid codes for as long as that key stays active, so a leaked key defeats the second factor. Turn two-factor authentication off and on again in the account's security settings to issue a new key, and never paste keys into pages shared in groups or forums that offer to generate codes for many accounts.
Link to answerWhy does my code keep getting rejected?
Nine times out of ten the clock is off. TOTP divides Unix time by the period — 30 seconds by default — so a device more than about 30 seconds out of sync produces a code for the wrong time step. Check that your system clock is set to network time, and confirm the algorithm, digit count and period match what the service issued.
Link to answerCan I use this as my only authenticator app?
You can, but keep the original secret or the service's recovery codes somewhere else as well. Vault data lives in this browser profile's IndexedDB, so clearing site data, using a different browser or losing the passphrase means the encrypted secrets are gone with no server-side copy to restore from.
Link to answerIs it safe to paste my 2FA secret into a web page?
Here the secret stays in the page: code generation runs through the browser's Web Crypto API and nothing is transmitted, logged or placed in the URL. That said, the general rule still applies — only paste a secret into a page you trust and have loaded over HTTPS, because any page you paste a TOTP seed into can generate codes forever.
Link to answerWhat is the difference between TOTP and HOTP?
The counter. HOTP (RFC 4226) increments a counter each time you request a code, while TOTP (RFC 6238) computes the counter from the clock as floor(unix_time / period), which is why the code rotates on its own every 30 seconds. Both then run the same HMAC and dynamic-truncation step to produce the digits.
Link to answer