What is OTP Code Generator?
OTP Code Generator — An OTP Generator is a free tool that creates one-time passwords and TOTP/HOTP codes for two-factor authentication testing and development.
Loading your tools...
Generate RFC 6238 time-based one-time passwords (TOTP) for two-factor authentication testing. Create setup QR codes for Google Authenticator, Authy, Microsoft Authenticator, and other 2FA apps. Configure secret keys, time periods, digit count, and hash algorithms (SHA-1, SHA-256, SHA-512).
OTP Code Generator: Enter a secret key or generate one to create time-based (TOTP) or counter-based (HOTP) one-time passwords. The 6-digit code refreshes every 30 seconds. Useful for testing 2FA implementations.
Generate and validate time-based OTP (one time password) for multi-factor authentication. totp generator, totp qr code generator.
Secret in hexadecimal
9f46f04e3d53f4877017
Epoch
1774836929
Iteration — Count
59161230
Padded hex
000000000386ba8e
OTP Code Generator — An OTP Generator is a free tool that creates one-time passwords and TOTP/HOTP codes for two-factor authentication testing and development.
Enter an existing Base32 secret key, or click Generate to create a new one.
Configure settings: time period (30s default), digits (6), and hash algorithm (SHA-1).
View the current TOTP code with countdown timer, plus previous and next window codes.
Scan the QR code with Google Authenticator or Authy to verify your 2FA implementation works.
Testing two-factor authentication implementations in web and mobile apps
Generating TOTP setup QR codes for authenticator app enrollment flows
Debugging OTP mismatch issues caused by clock drift or configuration errors
Validating 2FA backup and recovery workflows during security audits
TOTP (RFC 6238) works by combining a shared secret key with the current Unix timestamp divided by a time period (typically 30 seconds), then computing an HMAC hash and truncating it to produce a 6-digit code. Both the server and the authenticator app perform the same calculation independently — if the codes match, authentication succeeds. The standard allows for a ±1 window tolerance to handle minor clock drift.
The most common 2FA configuration uses SHA-1 with 6 digits and a 30-second period — this is what Google Authenticator defaults to. Some services use SHA-256 or SHA-512 for enhanced security, and 8-digit codes for lower collision probability. When debugging OTP mismatches, always check: (1) device clock accuracy, (2) Base32 secret encoding, (3) algorithm and digit count match between server and app.