TOTP Generator
Generate TOTP two-factor codes from a Base32 secret or otpauth:// URI locally with crypto.subtle. RFC 6238 compliant, no uploads.
π Runs entirely in your browser β nothing is uploadedGenerate two-factor codes locally
A time-based one-time password (TOTP) is the rotating 6-digit code used by authenticator apps for
two-factor authentication. This generator takes your Base32 secret key and computes the current
code directly in your browser using crypto.subtle with HMAC-SHA1, exactly as
described in RFC 6238. The shared secret never leaves the page: there is no upload, no account and
no server round trip. You can paste the raw Base32 string a service shows next to its QR code, or
paste the whole otpauth://totp/... URI and the tool will read the secret, digit count
and time period from its parameters automatically.
How TOTP works
TOTP builds on the HOTP algorithm. The current Unix time is divided by a time step, usually 30 seconds, to produce a counter value. That counter is hashed with HMAC-SHA1 using your secret key, and a dynamic truncation step turns the hash into a short numeric code, typically six digits. Both your device and the server run the same calculation, so they agree on the code as long as their clocks are close. Because the counter changes every 30 seconds, each code is short-lived and a captured code quickly becomes useless. The countdown ring on this page shows exactly how many seconds remain before the next code appears.
Keep your secret safe
The TOTP secret is as sensitive as a password, because anyone who has it can generate valid codes forever until you reset it. Treat this tool as a convenient way to read a code on a device where your authenticator app is not installed, not as long-term storage. Avoid pasting work or banking secrets into any browser tool you do not control, and clear the field when you are done. If a secret is ever exposed, disable two-factor authentication for that account and set it up again to rotate to a fresh secret. For everyday use, a dedicated authenticator app or hardware key on a trusted device remains the safest option, with this page serving as a quick local backup.
How to use
- Enter the secretPaste your Base32 secret key or a full otpauth:// URI from the service.
- Read the codeThe current 6-digit TOTP code is computed locally and shown immediately.
- Watch the timerThe countdown ring shows how many seconds remain before the code rotates.