2FA Code Generator (TOTP)

Type the base32 secret from your 2FA setup and get the current 6-digit code, plus the next one. Computed locally with WebCrypto.

Current code
—
Seconds remaining
—
Next code
—

Worked example

Secret JBSWY3DPEHPK3PXP is the standard test vector. At any moment it produces one 6-digit code, valid for the rest of the current 30-second window — the countdown above tells you how much of it is left.

A time-based one-time password is an HMAC over the current time step. The server and your device share a secret; both derive the same 6 digits from the same 30-second window without ever transmitting the code twice. That is why the codes work with no network at all — this page never calls out to anything.

How to use it

Paste the secret exactly as your service showed it. Most setup screens display a base32 string next to the QR code — often hidden behind an "enter this manually" or "can't scan?" link. Spaces and hyphens are ignored, and lowercase is fine.

If a code is rejected, check the device clock before anything else. TOTP has no tolerance for drift beyond the window your service allows, and a phone that is two minutes fast will produce codes that never validate. Some services accept the previous window; most accept one step of skew.

What this page does not do

It does not store the secret. Close the tab and it is gone — which is the right behaviour for a shared computer, and the wrong behaviour if you expected an authenticator replacement. For daily use, keep a real authenticator app that stores secrets in the system keystore.