QR Code Generator for 2FA (TOTP) - Authenticator App Compatible
Generate QR codes for two-factor authentication (2FA/TOTP). Compatible with Google Authenticator, Authy, and Microsoft Authenticator. Secure, offline, free.
About
Misconfigured two-factor authentication is worse than none at all. A wrong algorithm parameter, an incompatible digit count, or a malformed otpauth:// URI will produce QR codes that scan successfully but generate incorrect codes. The user locks themselves out. This tool generates QR codes that encode TOTP URIs per RFC 6238 and the Google Authenticator Key URI format. It uses a cryptographically secure random number generator (CSPRNG) via the Web Crypto API to produce secrets of 160 to 256 bits, Base32-encoded per RFC 4648. The QR matrix is computed locally using a full ISO/IEC 18004 implementation with Reed-Solomon error correction in GF(28). No data leaves your browser.
The tool validates that the issuer and account fields conform to URI-safe encoding rules and that the period T and digit count d fall within ranges supported by major authenticator apps. A live TOTP preview lets you verify the generated code matches your authenticator before deploying it. Note: some authenticator apps silently ignore non-default parameters (SHA-256, 8 digits). Test with your target app first.
Formulas
The TOTP algorithm derives a one-time password from the current Unix timestamp and a shared secret key. The time counter T is computed as:
The HMAC is computed over this counter value:
Dynamic truncation extracts a d-digit code:
The otpauth:// URI encodes all parameters into a scannable format:
Where K = Base32-encoded shared secret key (RFC 4648). T0 = Unix epoch (0). TX = time step in seconds (default 30). d = number of digits (6 or 8). Algo = hash algorithm (SHA1, SHA256, SHA512). The QR code uses ISO/IEC 18004 byte-mode encoding with error correction level M (~15% recovery) and applies the optimal mask pattern selected by minimum penalty score across 8 candidates.
Reference Data
| Authenticator App | SHA-1 | SHA-256 | SHA-512 | 6 Digits | 8 Digits | Custom Period | Notes |
|---|---|---|---|---|---|---|---|
| Google Authenticator | â | â | â | â | â | â (30s only) | Ignores period param silently |
| Authy | â | â | â | â | â | â | Syncs across devices |
| Microsoft Authenticator | â | â | â | â | â | â | Enterprise-focused |
| FreeOTP | â | â | â | â | â | â | Full RFC 6238 support |
| FreeOTP+ | â | â | â | â | â | â | Export/import support |
| andOTP | â | â | â | â | â | â | Android only, encrypted backups |
| Aegis Authenticator | â | â | â | â | â | â | Android only, open-source |
| 1Password | â | â | â | â | â | â | Integrated with password manager |
| Bitwarden | â | â | â | â | â | â | Premium feature |
| LastPass Authenticator | â | â | â | â | â | â | Basic TOTP only |
| Duo Mobile | â | â | â | â | â | â | Enterprise push notifications |
| KeePassXC | â | â | â | â | â | â | Desktop, full RFC support |
| Steam Guard | â (custom) | â | â | 5 chars | â | â (30s) | Proprietary alphanumeric codes |
| Yandex Key | â | â | â | â | â | â | PIN-protected |