Skip to content
UniKit

TOTP generator

Compute RFC 6238 TOTP codes from a Base32 secret: 30-second steps, a settable timestamp, 6–10 digits and SHA-1/256/512, verifiable against published test vectors.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Base32 secret

One-time password

One 30-second step, matching authenticator apps.

Enter a Base32 secret to see the code

Digits: 0 · Algorithm: · Window index: 0

What this tool does

  • Turn the Base32 secret an authenticator shows under "enter a setup key" into the code for a given moment, to check that both sides use the same parameters.
  • Self-check against the published RFC 6238 vector: 20-byte sample secret, timestamp 59 s, 8 digits should give 94287082.
  • Debug SHA-256 / SHA-512 variants and non-default lengths such as 7, 9 or 10 digits.

Example

Input

GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ

Output

94287082

Timestamp 59 s, 8 digits, SHA-1: this Base32 string is the 20-byte sample secret from RFC 6238 Appendix B (ASCII 12345678901234567890) and the published result is 94287082. With 6 digits it is 287082.

Frequently asked questions

Why does the code keep changing?

TOTP switches time steps every 30 seconds: the code is a dynamic truncation of HMAC(secret, floor(timestamp / 30)), so the same secret yields different codes at different timestamps. The timestamp field defaults to the current second; press "Use current time" to refresh it.

How do I match my authenticator app?

Paste the Base32 secret the app shows on its manual-entry screen (spaces are fine), keep the current timestamp, 6 digits and SHA-1, and both sides should display the same code. A different algorithm or digit count will not match.

Can the secret be lower case or contain spaces?

Yes. Spaces and hyphens are ignored and letters are upper-cased. The Base32 alphabet is only A–Z and 2–7, so a string containing 0, 1, 8 or 9 is rejected outright instead of producing a wrong code.

Does the page tick forward by itself?

No. The timestamp is a plain input pre-filled with the second the page was opened; press "Use current time" again after 30 seconds. That keeps results reproducible for checking instead of silently following the clock.

Keywords:TOTPBase32RFC 6238authenticator

Related tools