Skip to content
OTP Generator

TOTP Generator

Generate time-based one-time passwords (RFC 6238) from any Base32 secret. Supports 6 or 8 digits, 30 or 60 second periods and SHA1, SHA256 or SHA512.

Find it under “Can’t scan the QR code?” when you turn on 2FA. Only have the QR?

2Your code will appear here
Paste a key to start
Calculated in your browser. Your key is never sent anywhere.
On this page

What is a TOTP generator?

A TOTP generator turns a shared secret key into a short code that changes every few seconds. It is the same math that Google Authenticator, Microsoft Authenticator and Authy use. Because the code depends only on the secret and the current time, any correct TOTP generator will show the same code as your phone app.

Custom settings

Most services use the defaults: 6 digits, 30 seconds, SHA1. Some enterprise systems, VPNs and hardware-token replacements use 8 digits, a 60 second period or SHA256/SHA512. Open Advanced settings above to match them. If you paste a full otpauth:// link, the settings inside it are used automatically.

For developers

Testing a login flow? Generate a random secret with the 2FA QR code generator, scan it with your phone and compare codes here. This page follows RFC 6238 and passes the official RFC test vectors.

Frequently asked questions

Is TOTP the same as 2FA?

TOTP is one way of doing two-factor authentication. 2FA just means using two different proofs of identity; TOTP codes from an authenticator app are the most common second factor, alongside SMS codes, push prompts and security keys.

Why does my code not match my phone?

Check that both devices have the correct time, that the digits, period and algorithm match, and that you copied the newest secret key. Re-enabling 2FA on a service creates a new key and the old one stops working.

Does this TOTP generator store my secret?

No. The page does all calculations with your browser’s built-in Web Crypto API. The key is not saved, logged or sent anywhere, and the page keeps working if you disconnect from the internet after it loads.

Need a code right now?

Paste your key and get the current 6-digit code in seconds. Free, private and nothing to install.