2FA TOTP Code Generator
Free TOTP and 2FA code generator. Paste a base32 secret or otpauth:// link for live codes, or make a new secret with a QR code. Secrets stay on your device.
This tool works like an authenticator app in your browser. Paste a base32 secret or an otpauth:// URI and it shows the current time-based one-time password (TOTP, RFC 6238) with a countdown, plus the next code. Developers can also create a new random secret, set the issuer, digits, period and algorithm, and get the otpauth:// link and QR code to scan into Google Authenticator, Microsoft Authenticator, Authy or 1Password. Codes are computed with the otpauth library in your browser; the secret is never sent anywhere or saved.
Runs in your browser. The processing engine downloads once on first use, then the tool works offline. Your files never leave your device. Free, no sign-up.
Features
- Live TOTP code with countdown ring and next code
- Accepts base32 secrets and otpauth:// URIs
- SHA-1, SHA-256 and SHA-512; 6 or 8 digits; 30 or 60 s
- Generate a new random secret with QR code
- Verify a code with ±1 step tolerance
- Secret never leaves your device and is not stored
How to use 2FA TOTP Code Generator
- Paste a base32 secret or an otpauth:// link, or press New secret.
- Adjust the issuer, account, digits, period and algorithm if needed.
- Read the live code; the ring shows how many seconds it stays valid.
- Scan the QR code with an authenticator app, or check a code in Verify.
Frequently asked questions
How does a TOTP code work?
TOTP (RFC 6238) combines a shared secret with the current time. The number of 30-second steps since 1 January 1970 is signed with HMAC (usually SHA-1) using the secret, and part of the result becomes a 6-digit code. Your app and the server compute the same code independently, so nothing is sent between them.
Why is my code rejected?
The most common cause is a device clock that is out of sync, because codes change every 30 seconds. Turn on automatic date and time. Also check that the secret was copied completely and that the digits, period and algorithm match what the service expects; almost all services use 6 digits, 30 seconds and SHA-1.
Is it safe to paste my 2FA secret here?
The code is calculated in your browser and the secret is never uploaded, logged or saved, and the page works offline once loaded. Even so, a 2FA secret is as sensitive as a password: anyone who has it can generate your codes. Prefer a dedicated authenticator app for everyday logins and use this for testing or recovery.
What is an otpauth:// URI?
It is the link encoded inside the QR code a website shows when you enable 2FA, for example otpauth://totp/Example:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example. It carries the secret plus the issuer, account name, digits, period and algorithm.
What is the difference between TOTP and HOTP?
HOTP (RFC 4226) uses a counter that increases each time a code is used, while TOTP uses the current time instead of a counter. TOTP codes expire after a short period, which is why almost every authenticator app uses TOTP.
Related tools
- Password Generator — Strong random passwords, passphrases and PINs
- Password Strength Checker — Estimated crack time and weak-pattern warnings for a password, checked on your device
- QR Code Generator — Create customised QR codes instantly
- Hash Generator — MD5, SHA, SHA-3 and HMAC checksums for text and files
- JWT Decoder — Decode and inspect JSON Web Tokens safely offline
- Text Encryption — AES-256 encrypt and decrypt text or files