Live 2FA Code Generator
See the current one-time code with a countdown, plus a preview of the next code so you never miss the change.
Generate 2FA codes from a secret key, make a QR code and verify codes online. Your secret never leaves your browser.
Device time (UTC): --:--:--
Scan with Google Authenticator, Microsoft Authenticator, Authy, 1Password, Bitwarden or any TOTP app. Anyone who sees this QR code can generate your codes, so keep it private.
Codes are calculated inside your browser. Your secret key is never uploaded, logged or stored on our server.
Paste the Base32 secret or the full otpauth:// link, or generate a new random secret.
A 6-digit code appears and refreshes with a countdown. Copy it with one click.
Make a QR code to scan into an authenticator app, or check a code with the Verify tab.
Need a 2FA code without your phone? This free TOTP authenticator generates time-based one-time passwords from a Base32 secret key, creates an otpauth QR code and verifies codes, following RFC 6238 with SHA-1, SHA-256 or SHA-512. Everything runs in your browser with the Web Crypto API, so your secret is never uploaded or stored. Use it for testing, development and backups, and keep real secrets on devices you trust.
See the current one-time code with a countdown, plus a preview of the next code so you never miss the change.
Built on HOTP (RFC 4226) with SHA-1, SHA-256 or SHA-512, 6 to 8 digits and 15, 30 or 60 second periods.
Turn a secret into an otpauth:// link and QR code you can scan into any authenticator app.
Test a code against the secret and see if it matches the current step or a nearby one.
Create a random 160-bit Base32 secret with your browser's secure random number generator.
No uploads, no account and nothing saved. Your secret stays on your device and disappears when you close the tab.
otpauth:// link. To start fresh, click Generate a new secret.TOTP is the standard behind most two-factor authentication (2FA) apps. It is defined in RFC 6238 and extends the HOTP algorithm from RFC 4226. When you enable 2FA, the service and your app share a secret key. After that, both sides can calculate the same short code from that secret and the current time, so nothing needs to be sent over the network when you log in. Because each code is valid for only a short window, a stolen code is useless after a few seconds.
007081.This tool runs exactly these steps in your browser using the Web Crypto API, and it matches the test vectors published in RFC 6238.
| Setting | Common value | What it does |
|---|---|---|
| Algorithm | SHA-1 (default) | The HMAC hash used to calculate the code. SHA-256 and SHA-512 are allowed by RFC 6238 but fewer apps support them. |
| Digits | 6 (default) | Length of the code. Some services use 8 digits. |
| Period | 30 seconds (default) | How long each code stays valid before the next one replaces it. |
| Secret | 16 to 32 Base32 characters | The shared key, written with letters A-Z and digits 2-7. Keep it private. |
Some authenticator apps ignore custom values and always use SHA-1, 6 digits and 30 seconds, so keep the defaults unless your service requires something else.
The QR code you scan when enabling 2FA is just an otpauth:// link. Pasting it into the secret field fills in every setting automatically.
| Part | Example | Meaning |
|---|---|---|
| Scheme and type | otpauth://totp/ | Marks the link as a time-based one-time password |
| Label | Example:you@example.com | Issuer and account name shown in the app |
secret | JBSWY3DPEHPK3PXP | The Base32 shared secret (required) |
issuer | Example | The service name (recommended) |
algorithm | SHA1 | SHA1, SHA256 or SHA512 |
digits | 6 | Length of the code |
period | 30 | Seconds per code |
| Method | How the code is made | Works offline? | Main weakness |
|---|---|---|---|
| TOTP | Secret key + current time | Yes | Phishing and a stolen secret |
| HOTP | Secret key + counter | Yes | Counters can drift out of sync |
| SMS codes | Sent by the service over the phone network | No | SIM swapping and interception |
| Passkeys / security keys | Public-key cryptography | Yes | Needs support from the service |
TOTP is a big step up from a password alone and from SMS codes, but it can still be phished if you type a code into a fake site. Passkeys and hardware security keys resist phishing better where they are supported.
| Use case | How the TOTP authenticator helps |
|---|---|
| Developers testing 2FA | Generate valid codes to test login flows without picking up a phone. |
| QA and automation | Check that your server accepts codes and handles time drift correctly. |
| Backup access | Regenerate a code from a saved secret key if your phone is unavailable. |
| Setting up new apps | Create a secret and QR code for an app you are building. |
| Learning | See how time-based one-time passwords change and how the settings affect them. |
Test a password with our password strength checker.
This page runs locally: your secret is used inside your browser to calculate codes and is never sent to our server, stored in cookies or saved in local storage. You can confirm that in your browser’s network tab. Even so, a TOTP secret is as sensitive as a password. Only paste real secrets on a device you trust, avoid shared computers, and close the tab afterwards. For your most important accounts, a dedicated authenticator app or hardware key on your own phone is the safer everyday choice, and this tool is best for testing, development and emergency backup.
The tool supports time-based codes (TOTP) only, not counter-based HOTP, push approvals or Steam Guard style codes. It does not save accounts, so you need the secret each time. It relies on your device clock, and it cannot recover a lost secret or reset 2FA on a service. The QR code uses the standard otpauth:// format, but some apps ignore non-default algorithm, digit and period values.
Check a password with the password strength checker. Inspect tokens with the JWT decoder. Browse all free online tools for security, developers, SEO, writing, PDF and image work.
Short answers about authenticator codes, secret keys and how this tool works.
A TOTP (time-based one-time password) authenticator creates a short code, usually 6 digits, from a shared secret key and the current time. The code changes every 30 seconds and is used as the second step of two-factor authentication (2FA).
The secret is processed in your browser with the Web Crypto API and is never sent to our server or saved, and you can check this in your network tab. Still, a secret key is as powerful as your authenticator app, so for important accounts use a dedicated app on your phone and use this page for testing, learning and backups on a trusted device.
When you turn on 2FA, most services show a QR code and a link such as "Can't scan the code?" or "Enter setup key manually". That text is the Base32 secret. You can also paste the full otpauth:// link into the secret field and the tool fills in the settings for you.
The most common cause is a wrong device clock, because TOTP depends on accurate time. Also check that the secret is typed correctly and that the algorithm, digits and period match your service. Use the Verify tab with a time drift of one step to see whether the clock is slightly off.
TOTP codes are generated on your device from a secret and the time, so they work offline and cannot be intercepted on the phone network. SMS codes travel over the mobile network and can be exposed by SIM swapping, which is why authenticator apps are generally considered stronger.
It produces the same codes as any standard TOTP app when the settings match, so it works as a backup or for testing. It does not store your accounts, though, so each visit needs the secret again. For daily use, a dedicated authenticator app or password manager is more convenient and safer.
They define how the code is calculated. Nearly every service uses SHA-1, 6 digits and a 30-second period, which are the defaults here. Only change them if your service or the otpauth:// link specifies different values, otherwise the codes will not match.
Merge, split, compress and convert files in seconds. Explore powerful free tools for all your everyday needs.
Explore All Tools →