Tools · Security & Auth

2FA TOTP token generator

Generate live two-factor authentication codes from Base32 secrets. Tested against RFC 6238, running 100% in your browser sandbox.

100% Client-Side RFC 6238 (Zero Network Calls)
Current 6-Digit 2FA Passcode
30s
--- ---
01 / DRIFT TOLERANCE

Allow ±1 Time Step Verification

Server clocks and user mobile phones can drift by several seconds. Production TOTP verifiers must always check the current 30s window plus ±1 interval (3 total steps) to prevent frustrating login failures.

02 / REPLAY ATTACKS

Invalidate Used Codes Immediately

Even though a TOTP code remains mathematically valid for 30 seconds, your backend must store recently verified codes in a high-speed Redis cache and immediately reject duplicate submissions within the same window.

03 / RECOVERY

Backup Scratch Codes Are Mandatory

Never enroll a user into 2FA without simultaneously issuing 8 to 10 single-use cryptographically hashed recovery scratch codes. Lost authenticator devices without recovery fallback lead to permanent account lockouts.