security

TOTP Generator

Generate 2FA codes from any TOTP secret key. Fully local — your key never leaves your browser.

shield100% local — key never transmitted
Secret Key
Base32 encoded secret from your authenticator setup (e.g. JBSWY3DPEHPK3PXP)
— — —
Click code to copy
Enter a secret key to start
Next code
Code in s — — —
How TOTP Works
1
You and the server share a secret key (base32 encoded string). This is exchanged once during setup, usually by scanning a QR code.
2
The current Unix time is divided into 30-second windows: T = floor(unixtime / 30). This value is the same for both you and the server at the same moment.
3
An HMAC-SHA1 hash is computed over T using the secret key. The hash is truncated to extract a 6–8 digit number — this is your OTP.
4
The server performs the same calculation and compares the result. If they match (allowing ±1 window for clock skew), the login is approved.

Frequently Asked Questions

Yes. This tool uses only browser-local JavaScript — no network requests are made after the page loads. Your TOTP secret is never sent to any server, logged, or stored in any way. You can disconnect from the internet and the tool will continue to work correctly.

TOTP (Time-based One-Time Password) is an algorithm defined in RFC 6238. It generates a short numeric code from a shared secret key and the current time. The code rotates every 30 seconds and is used for two-factor authentication. Both the app and the server compute the same code independently — no communication is needed at authentication time.

Yes. This generator implements the standard RFC 6238 TOTP algorithm with HMAC-SHA1, 6-digit codes, and 30-second periods — the same parameters used by Google Authenticator, Authy, Microsoft Authenticator, Bitwarden, 1Password, and virtually all other 2FA apps and services.

About the TOTP Generator

Generate Time-based One-Time Passwords (TOTP) from any base32 secret key — the same codes used by authenticator apps like Google Authenticator and Authy. Enter your secret key and see the current 6-digit code along with a countdown to the next rotation. Runs entirely in your browser with no data sent externally.