Free 2FA Code Generator
Paste a secret key, an otpauth:// link or a whole list. Live codes appear instantly and refresh on their own. Your keys are never sent to a server.
Secret keys
One per line. Accepted: plain key, key with spaces, ID|Password|2FA, user:pass:key, otpauth:// links, Google Authenticator export links.
Options
Keys written as otpauth:// links keep their own algorithm, digits and period. Your input is never saved unless you press “Save to vault”.
Add account
Protection & backup
Without a password the vault is stored as plain text in this browser. With a password it is encrypted (AES-256-GCM, PBKDF2). If you forget the password it cannot be recovered.
Export / import
Import from QR code
Drop a screenshot, paste an image (Ctrl+V) or use your camera. Works with normal 2FA QR codes and Google Authenticator “Export accounts” QR codes.
Secret key & QR generator
Create a new random secret, get its otpauth link and QR code, and scan it into any authenticator app.
Key checker & fixer
Find out why a key is rejected: wrong characters, too short, or a different encoding (hex).
Why is my code rejected?
Enter the secret and a code that a site or app showed. We look for it around your current time and tell you if a clock is off, and by how much.
Clock check
2FA codes depend on exact time. Compare your device clock with this website's server and optionally correct the codes shown here.
Frequently asked questions
What is a 2FA / TOTP code generator?
Two-factor authentication (2FA) apps turn a shared secret key and the current time into a 6-digit code that changes every 30 seconds (the TOTP standard, RFC 6238). Code2FA does the same calculation in your browser, so you can get codes without a phone app.
Is it safe to paste my secret key here?
All calculations run locally with your browser's Web Crypto API. Keys are not uploaded, and you can confirm it in the Network tab of your developer tools. Anything you paste exists only in the page memory until you close or clear it. Still, for very valuable accounts, use a device you trust.
Where do I find my 2FA secret key?
When you turn on two-factor authentication on Shopify, Facebook, Google, GitHub and most other sites, choose “Can't scan the QR code” or “Enter key manually”. The text shown (letters A–Z and digits 2–7, often in groups of four) is the secret key. You can also drop a screenshot of the QR code into the Tools tab.
Why does the site say my code is wrong?
Almost always a clock problem. TOTP is time-based, so even 30–60 seconds of drift breaks it. Open Tools → “Why is my code rejected?” to measure the drift, or use Clock check to compare with a server.
Can I get many codes at once?
Yes. Paste one account per line in any common format (key only, ID|Password|2FA, user:pass:key, otpauth:// …). Every line gets its own live code, and you can copy all codes or export them as CSV.
Can I move my accounts from Google Authenticator?
Yes. In Google Authenticator choose “Export accounts”, take a screenshot of the QR code and drop it into Tools → Import from QR code. All accounts are decoded in your browser.
Does it work offline?
After the page has loaded you can disconnect from the internet and keep generating codes. Only the optional clock check needs the network.