Two-factor authentication (2FA) adds a second proof of identity beyond your password: a short code that changes every 30 seconds and can only be produced by someone holding your secret. This generator produces exactly the codes an authenticator app would show from the same secret, using the open RFC 6238 standard — so you can verify a secret, recover access when your phone is elsewhere, or test a 2FA setup before relying on it.
How to use
- Paste the Base32 secret from your service's 2FA setup screen (the “can't scan the QR code?” text).
- The live code appears immediately and refreshes with the countdown bar.
- Copy the code and enter it where the service asks for it.
- Optionally fill in the account and issuer to build an otpauth:// link for your authenticator app.
About this TOTP code generator
TOTP (time-based one-time password) works by combining your secret with the current time: the secret is HMAC-signed with a counter derived from the time, and a 6-digit code is taken from the result. Because both sides use the same secret and the same clock, the codes match. The standard is RFC 6238 with HMAC-SHA-1 and a 30-second period — the same as Google Authenticator and most other apps. The code is computed here with the browser's built-in WebCrypto, and the page is tested against the RFC 6238 test vectors, so a code shown here is the code your app should show too — if it differs, your device clock is usually the cause.
How do I use this tool?
- Enter the Base32 secret in the first box.
- Read the live 6-digit code and watch the countdown bar.
- Press “Copy code” to copy it, or “Generate a new secret” to create a fresh random secret for testing.
- Use “Copy authenticator link” to move a working secret into your authenticator app.
Where is this tool used?
When a 2FA setup screen shows a secret instead of a QR code; when your phone is charging in another room and a login asks for a code; when testing that a server's 2FA setup produces the codes you expect; and when learning how time-based codes actually work. It is also the fastest way to confirm a backup secret you wrote down is correct before you need it in an emergency.
What are the limitations?
Codes depend on the clock: if your device time is more than 30 seconds out, the codes will not match and the service will reject them — check your clock before assuming the secret is wrong. This page does not store secrets, so refreshing the tab means entering the secret again; a real authenticator app is the right place for secrets you use daily. And a 2FA code only helps if your password is also strong and unique — codes cannot fix a breached password.
Frequently asked questions
Where do I find my authenticator secret?
On the service's 2FA setup screen, look for “Can't scan the QR code?” or “Enter the key manually”. The string of letters and digits shown there — usually 16 or 32 characters — is the Base32 secret. Paste it here.
Why does my code not match my authenticator app?
Almost always the clock: TOTP codes depend on the current time, so if your device clock is off by more than 30 seconds the codes will differ. Check that your device time is set automatically, then compare again.
Is it safe to paste my secret into this page?
The secret is used only inside your browser tab to compute codes and is never uploaded, stored or sent anywhere. For secrets you use every day, an authenticator app on your phone is still the better home — this page is best for one-off checks.
What is the otpauth:// link for?
It is the standard format authenticator apps use to import an account: secret, account name, issuer and settings in one link. Copy it into your app's manual-entry screen instead of typing the secret by hand.
What is the difference between 6-digit and 8-digit codes?
Most services use 6 digits, which is the default. A few services ask for 8 digits; choose it in the dropdown if yours does. The secret and the 30-second period stay the same.
Updated November 2026 · Built and tested by Sharjeel Tahir · How our tools are tested