TOTP Generator
The six-digit codes in your authenticator app are not sent to you by anyone. Your phone and the server both hold the same secret and both know the time, so each can compute the code independently. This page does exactly what the app does:
- decode the Base32 secret (the text under the QR code on any 2FA setup page)
- divide the current Unix time by 30 seconds to get a counter
- compute HMAC-SHA1 of that counter with the secret, using the Web Crypto API
- take 31 bits from a position chosen by the last nibble and reduce them modulo 10⁶
The ring shows the seconds left in the current window and the next code is previewed so you can see the rollover. Algorithm, period and digit count are adjustable for services that deviate from the defaults. The generated otpauth:// URI is what a QR code would contain, useful when you are implementing 2FA yourself.
See the concept animation on this page for the counter → HMAC → code pipeline in motion.
What leaves your browser
Secrets are decoded and used in your browser only; nothing is transmitted or stored, and the page forgets the secret when closed. Anyone with the secret can generate valid codes, so paste only secrets you own, on a device you trust.
Is it safe to paste my 2FA secret here?
The computation is local and you can confirm no request is made. But a secret pasted anywhere is a secret that has been exposed once more. Use this for testing and development, not routinely for your bank.
Why does my code not match my authenticator app?
Almost always clock drift on one device, or a non-default period, digit count or algorithm. Check the service's otpauth URI for those parameters.
Can I use this instead of an authenticator app?
You could, but you would have to store the secret somewhere and paste it each time. A password manager with built-in TOTP is the practical option.
What is the difference between TOTP and HOTP?
HOTP (RFC 4226) uses a counter that increments per use; TOTP (RFC 6238) uses the time as the counter. Authenticator apps use TOTP.