2FA Code Generator
Generate TOTP two-factor authentication codes from your secret key. Everything runs locally in your browser.
Your 2FA Code
Your secret key never leaves your browser. All codes are generated locally using JavaScript. No data is sent to any server.
What is 2FA / TOTP?
Two-Factor Authentication (2FA) adds an extra layer of security to your online accounts. TOTP (Time-based One-Time Password) is the most common 2FA method — it generates a 6-digit code that changes every 30 seconds based on a shared secret key.
Apps like Google Authenticator, Authy, and Microsoft Authenticator use TOTP to generate these codes. Our tool works the same way — just enter your secret key and get the current 6-digit code instantly.
How to Use
Get your secret key
When setting up 2FA on a website, you'll be shown a secret key (usually a Base32 string like JBSWY3DPEHPK3PXP) or a QR code.
Enter the secret key
Paste or type the secret key into the input field above. Spaces and dashes are automatically removed.
Get your code
The 6-digit TOTP code will be generated and auto-refresh every 30 seconds. Copy and use it to log in.
Frequently Asked Questions
Is it safe to enter my secret key here?
Yes. The TOTP code is generated entirely in your browser using JavaScript. Your secret key is never sent to any server or stored anywhere.
Why does the code change every 30 seconds?
TOTP codes are time-based. The algorithm combines your secret key with the current time (in 30-second intervals) to produce a unique code. This ensures that even if someone sees one code, it becomes useless after 30 seconds.
Where do I find my secret key?
When you enable 2FA on a website, it usually shows a QR code and a text-based secret key (Base32 encoded). Save the text key — that's what you enter here.
Can I use this instead of Google Authenticator?
Yes. This tool uses the same TOTP algorithm (RFC 6238) as Google Authenticator, Authy, and other authenticator apps. The generated codes are identical.