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

How to use 2FA TOTP Code Generator

  1. Paste a base32 secret or an otpauth:// link, or press New secret.
  2. Adjust the issuer, account, digits, period and algorithm if needed.
  3. Read the live code; the ring shows how many seconds it stays valid.
  4. 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

All free tools · This tool as Markdown