TOTP Generator
Generate TOTP codes from a secret and understand why they drift, expire and occasionally fail.
TOTP Generator
Generate Time-based One-Time Passwords (2FA) for testing.
Current Code
Need this handled by experts?
Radiatus runs VAPT, managed SOC & security engineering for regulated teams.
The code is derived, not transmitted
TOTP takes a shared secret and the current Unix time divided by a 30-second step, runs HMAC-SHA1 over them, and truncates the result to six digits. Both sides compute the same value independently — nothing is sent, which is why TOTP works offline and why intercepting the network gives an attacker nothing beyond that 30-second window.
Clock drift is the usual failure
Because the input is time, a device whose clock is wrong produces wrong codes. Servers typically accept the previous and next step to tolerate a minute of skew. A phone that has drifted further fails every attempt, and the fix is enabling automatic network time rather than re-scanning the QR code.
The secret is the account
Anyone holding the base32 secret can generate valid codes forever. It appears in the QR code and in the manual-entry string, so a screenshot of a setup QR sitting in a photo library is a permanent credential. Backup codes deserve the same handling as the secret itself.
What TOTP does and does not stop
It defeats credential stuffing and password reuse completely, since a stolen password alone is useless. It does not stop real-time phishing: a proxy page can capture the code and replay it within its window. Only origin-bound factors such as WebAuthn or passkeys close that, which is why high-value accounts are moving to them.
SHA-1 here is not a weakness
HMAC-SHA1 remains sound despite SHA-1's collision problems, because HMAC does not depend on collision resistance. The algorithm is fixed by RFC 6238 and by every authenticator app, so changing it breaks compatibility for no security gain.
Frequently Asked Questions
Privacy & Security
Local generation.
About This Tool
This tool runs entirely in your browser. No data is sent to any server, ensuring complete privacy. Simply use the interface above to get started — no registration or login required.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
Password Strength Checker
SecurityMeasure password strength by entropy and pattern analysis rather than character-class rules. Checked entirely in your browser.
Password Generator
SecurityGenerate strong random passwords and passphrases in your browser using the Web Crypto API. Nothing is transmitted, logged or stored.
Hash Generator
SecurityGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes in your browser. Compare checksums and verify file integrity with nothing uploaded to a server.