What is TOTP?

TOTP stands for Time-based One-Time Password. It generates short numeric codes that change on a fixed schedule (commonly every 30 seconds) using a shared secret and the current time. You’ll most often see TOTP in authenticator apps as a second factor: even if someone learns your password, they still need the temporary code from your device.

The standards behind it (RFCs)

TOTP is defined by RFC 6238. It’s built on top of the earlier HOTP algorithm (HMAC-based One-Time Password, defined by RFC 4226). You can think of it like this:

That’s why TOTP codes “roll” automatically—time keeps increasing, so the effective counter changes on its own.

How TOTP works (high level)

Both your server and your authenticator app store the same secret key (often encoded as Base32 in a QR code). To compute a code, they:

RFC 6238 specifies common parameters like a 30-second time step and default hashing (historically HMAC-SHA-1, with options for SHA-256 and SHA-512 as well).

Why it’s useful for 2FA

The main benefit is that the code is valid only briefly, which limits the time window for reuse. A stolen password alone isn’t enough; the attacker also needs the current TOTP code generated from the shared secret.

Important security notes

In short: TOTP is a standardized, time-synchronized way to produce one-time codes from a shared secret. It’s not perfect (especially against real-time phishing), but it’s still a strong upgrade over passwords alone.

Back to generator

made by h4nz4