Generate time-based one-time passcodes from a Base32 secret using RFC 6238, entirely in your browser. Configure the algorithm, digit count, and refresh period.
The six digits your authenticator app shows every thirty seconds aren’t random. They’re an HMAC signature over the current time, truncated down to something short enough to type before it expires. TOTP Generator runs that exact RFC 6238 algorithm locally, signing with the browser’s own crypto.subtle implementation rather than a hand-rolled substitute.
Reach for it when you’re debugging a 2FA integration and need to see what code your server should be expecting without reaching for your phone, checking a backup secret before you commit to relying on it, or building something that consumes TOTP codes and needs known-good test values. Paste a secret, or generate a fresh one, and a code appears immediately.
Every code is HOTP(secret, counter) truncated to however many digits you asked for, where counter is the current Unix time divided by the period and rounded down — RFC 6238 layered on RFC 4226’s HMAC-based one-time password. A freshly generated secret decodes to 20 bytes, a 160-bit key, which is the length HMAC-SHA1 is built around; a shorter pasted secret still works, just from less entropy. This implementation has been checked against all four published RFC 6238 test vectors, the same seed and timestamps the spec itself uses to verify a compliant implementation, and matches every one of them exactly.
Typing a real account’s TOTP secret into any web page, this one included, gives that page’s JavaScript the same access to it a keylogger would have. That trade is fine for a throwaway secret you generated to test something, and it is not fine for the secret behind your email or your bank. Nothing here is written to disk: the value lives in React state and disappears on refresh, but “gone on refresh” is a much weaker guarantee than a dedicated authenticator app makes. For an account that actually matters, use the app your provider issued the QR code for in the first place.
Algorithm
Digits
Period (seconds)
SHA-1, 6 digits, 30s is what nearly every authenticator app expects. Change these only if you are testing a custom TOTP implementation.
······Computed locally with crypto.subtle — the secret never leaves this tab.
How it works
Paste the Base32 secret an authenticator app would normally scan as a QR code — the “can’t scan this code?” text underneath it — or click the dice icon for a fresh random one to test with. The code updates on its own every time the period elapses, computed with HMAC over a counter derived from the current Unix time, exactly as RFC 6238 defines it.