2FA Code Generator
Get your two-factor authentication codes from a secret key or QR code, just like Google Authenticator — or create new 2FA secrets and QR codes for your own app. Everything stays in your browser.
The Base32 “setup key” shown when you turn on 2FA. Spaces and lowercase are fine.
Advanced settings TOTP · SHA-1 · 6 digits · 30 s
30 s left · next code
Your code will appear here
Enter a secret key or scan a QR code.
SHA-1, 6 digits and 30 seconds work with every authenticator app. Other settings are ignored by some apps, including Google Authenticator on older phones.
Scan the QR code, then type the code your app shows.
Scan with Google Authenticator, Microsoft Authenticator, Authy, 1Password or any TOTP app.
How to Use the 2FA Code Generator
Get the same six-digit codes your authenticator app would show — or set up 2FA for your own app.
Add your secret
Paste the setup key (Base32) or otpauth:// link, scan a QR screenshot, or use your camera.
Check the settings
Most sites use TOTP, SHA-1, 6 digits and 30 seconds. Links and QR codes set this for you.
Copy the code
Click the code to copy it. The bar shows how long it’s valid, and the next code is shown too.
Create your own (optional)
In Create 2FA secret, make a random secret and QR code, scan it with your phone and test a code.
TOTP
Time-based codes
HOTP
Counter codes
QR scan
Image or camera
Create
Secret + QR
Verify
Test any code
Import
Authenticator export
Privacy
Never stored
Price
100% free
2FA Code Generator Features
A complete online authenticator and 2FA toolkit — private by design.
Live TOTP codes
See the current code with a countdown bar and the next code, so you’re never caught by the 30-second change.
Every setting supported
SHA-1, SHA-256 and SHA-512, 6, 7 or 8 digits, and 15, 30, 60 or 90-second periods — plus counter-based HOTP.
Scan QR codes
Upload or paste a screenshot of a 2FA QR code, or scan it live with your camera.
otpauth:// links
Paste a full otpauth:// link and the secret, issuer, account and settings are filled in automatically.
Google Authenticator export
Paste or scan an otpauth-migration:// export QR to see every account inside it.
Create 2FA secrets
Generate a random 80 to 512-bit secret with a scannable QR code and otpauth:// link for your app or website.
Download QR codes
Save the setup QR code as PNG or SVG for documentation or onboarding.
Verify codes
Type the code your phone shows to confirm the setup works — with a clock-drift warning if it’s one step off.
Nothing saved or sent
Secrets stay in your browser’s memory only and disappear when you close the tab.
Standard 2FA Settings
What each setting means — and the values almost every service uses.
| Setting | Common value | What it means |
|---|---|---|
| Type | TOTP | Time-based one-time password (RFC 6238). HOTP uses a counter instead (RFC 4226). |
| Algorithm | SHA-1 | The hash used inside HMAC. SHA-256 and SHA-512 are supported by fewer apps. |
| Digits | 6 | How long each code is. Some banks and Steam-like systems use 8. |
| Period | 30 seconds | How often a new code appears. |
| Secret | 16–32 Base32 characters | The shared key, usually 160 bits (32 characters). |
2FA Methods Compared
Authenticator codes are a big step up from SMS.
| Method | Security | Works offline | Notes |
|---|---|---|---|
| SMS codes | Low | No | Vulnerable to SIM swapping and interception |
| Email codes | Low–medium | No | Only as safe as your email account |
| Authenticator app (TOTP) | High | Yes | The most widely supported strong option |
| Passkeys / security keys | Very high | Yes | Phishing-resistant — use where available |
Who Uses It?
For people setting up, testing and recovering 2FA.
Developers
Test TOTP login flows without a phone.
QA testers
Log in to test accounts protected by 2FA.
App builders
Create secrets and QR codes for your users.
IT admins
Verify a user’s authenticator is set up right.
New phone
Read codes from a saved setup key while moving apps.
Desktop access
Get codes on your computer when your phone is away.
Export check
See which accounts are in an Authenticator export.
Learning
Understand how TOTP codes are calculated.
Tips for Safe Two-Factor Authentication
- Treat secrets like passwords. Anyone with your setup key can generate your codes.
- Save backup codes. Store the recovery codes each site gives you somewhere safe.
- Keep your clock automatic. TOTP depends on the time — a clock that’s off makes codes fail.
- Use a real app day to day. An authenticator app on your phone keeps the second factor on a separate device.
- Stick to the defaults. SHA-1, 6 digits and 30 seconds work with every authenticator app.
- Prefer passkeys when offered. They protect against phishing better than any code.
Private by Design
Codes are calculated in your browser with the Web Crypto API. Your secret keys, QR codes and codes are never uploaded, logged or saved — not even in your browser’s storage — and they’re gone when you close the tab.
QR images are read on your device. The camera feed never leaves your browser.
Frequently Asked Questions
Answers about 2FA codes, TOTP secrets and authenticator apps.
Paste the secret key (the Base32 setup key, like JBSWY3DPEHPK3PXP) into the box. The current 6-digit code appears straight away with a countdown, exactly as an authenticator app would show it.
This one calculates codes entirely in your browser and never sends or stores your secret. Even so, your secret key is as sensitive as a password, so for everyday logins keep using an authenticator app on your phone.
TOTP (Time-based One-Time Password, RFC 6238) creates a new code every 30 seconds from a shared secret and the current time. Google Authenticator, Microsoft Authenticator, Authy and 1Password all use it.
TOTP codes change with time. HOTP (RFC 4226) codes change only when a counter goes up, usually each time you press a button. Choose HOTP under Advanced settings and use Next code to move the counter.
The most common reason is a device clock that’s wrong by more than about 30 seconds — set your time automatically. Also check the secret has no typos and that the algorithm, digits and period match the site’s settings.
Yes. Click Scan QR image and choose a screenshot, paste a screenshot with Ctrl+V, or click Use camera. The otpauth:// link inside is read on your device.
Open Create 2FA secret, enter your app name and the user’s account, and a random secret with a QR code is made. Your users scan the QR code; your server stores the secret and checks codes with any TOTP library.
It’s the standard format stored in 2FA QR codes, for example otpauth://totp/Issuer:[email protected]?secret=…&issuer=Issuer. It contains the secret plus optional algorithm, digits and period.
Yes. Scan the Transfer accounts QR code (otpauth-migration://) or paste its link, and every account inside is listed so you can view each one’s codes.
No. Secrets are only kept in the page’s memory while it’s open. Nothing is written to cookies or local storage, and nothing is sent to Toolszu.
Base32 uses the letters A–Z and numbers 2–7. Spaces, dashes and lowercase are ignored. If you see 0, 1 or 8, it’s probably the letter O, I or B.
Yes, it’s completely free with no sign-up and no limits.
Related Free Tools
Get Your 2FA Code Now
Paste a secret or scan a QR code and see your code instantly. Free, private and no sign-up.
Start Now