TOTP Secret Key Generator
Generate Base32-encoded secrets for 2FA apps like Google Authenticator
or press R
TOTP Secrets
160b entropy
How TOTP Works
TOTP generates a 6-digit code that changes every 30 seconds. Both the server and the user's authenticator app share the same secret key, allowing them to generate matching codes without network communication.
- Based on HMAC-SHA1 algorithm (RFC 6238)
- Uses Unix timestamp divided by 30-second intervals
- Base32 encoding for easy manual entry
Security Considerations
- Store secrets encrypted in your database
- Show the secret/QR code only once during setup
- Provide backup codes for account recovery
- Use 160+ bits (20+ bytes) for production
OTPAuth URI Format
Use this format to generate a QR code for authenticator apps:
otpauth://totp/YourApp:[email protected]?secret=SECRET_HERE&issuer=YourApp&algorithm=SHA1&digits=6&period=30