TOTP Code Generator
Time-based one-time codes from a secret
Codes are computed in your browser with WebCrypto. The secret is never uploaded or stored, and clears on reload.
—
| Time counter T | — |
|---|---|
| Current Unix time | — |
| otpauth:// URI | otpauth://totp/Example?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&period=30 |
TOTP (RFC 6238) is HOTP with a clock for a counter: T = floor(unix seconds / period), HMAC the 8-byte big-endian T with the secret, then dynamically truncate 4 bytes and take the last N decimal digits. Any correct implementation yields the same code for the same secret and window, which is why it verifies offline.
All processing happens locally in your browser. Your data is never uploaded to a server.