Free online tool. All processing is client-side. No signup needed.
An OTP (One-Time Password) Code Generator creates time-based (TOTP) codes for two-factor authentication (2FA) — the same type of codes used by Google Authenticator, Authy, Microsoft Authenticator, and 1Password. OTP codes are the second most common 2FA method after SMS, providing significantly better security: they're generated locally from a shared secret (the TOTP key) and can't be intercepted via SIM-swap attacks like SMS codes. This tool generates codes from any TOTP secret, which is useful for testing, backup access, and understanding how 2FA works.
Enter the TOTP secret key (Base32 encoded, the string you see as a QR code backup code, like 'JBSWY3DPEHPK3PXP'). The generator computes the current 6-digit code, which changes every 30 seconds. It shows: current code, seconds remaining until code changes, the next code, and standard algorithm details (SHA-1, 30-second interval, 6 digits — configurable). The validator checks any code against the secret. All processing is client-side; the secret never leaves your browser.
TOTP Algorithm (RFC 6238):\n\n1. T = floor((Current Unix Time − T0) ÷ TX), where T0=0, TX=30s\n2. Convert T to 8-byte big-endian\n3. HMAC-SHA1(Secret, Counter)\n4. Dynamic Truncation: extract 4 bytes from HMAC result\n5. Code = (extracted_value & 0x7FFFFFFF) % 10^Digits (default: % 1,000,000)\n6. Pad to 6 digits with leading zeros\n\nSecret Format: Base32 encoded (A-Z, 2-7)\nDefault Parameters: SHA-1, 30s interval, 6-digit code\n\nCode Window: current code ± 1 interval (to account for clock skew)\nCounter Sync: HOTP uses incrementing counter instead of time (rarely used now)
Our tool processes everything client-side — your secret never leaves your browser. However, as a general security practice, use your authenticator app for day-to-day 2FA and this tool only for testing/backup scenarios.
The 30-second window limits the time a stolen code is usable. Even if an attacker intercepts a code, it expires quickly. The 30-second interval is a balance between security (shorter is better) and usability (enough time to type the code).
Free online Otp Code Generator And Validator — no signup, 100% client-side processing. All data stays in your browser.