Generate TOTP

Generate a time-based one-time password from a Base32 secret.

freeworks offlinenothing uploaded
ToolTOTP Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

A Base32 secret and Unix time become a counter using a fixed time step; HMAC truncation then produces a six- or eight-digit code. The countdown shows how long the current time window remains.

  • RFC 6238 uses a 30-second step and commonly six digits.
  • SHA-1 remains the compatibility default for authenticator apps.

Worked example

The RFC 6238 SHA1 test secret at T=59
A fixed timestamp, since a real run would use the current time
Input
											Secret: GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
Timestamp seconds: 59
										
Output
												Code: 287082
Seconds remaining: 1
Period start: 30
Period end: 60
											

When to use this

Authenticator apps, implementation test fixtures, and MFA enrollment run TOTP.

Edge cases

  • Unpadded but otherwise valid Base32 secrets still decode.
  • A clock several steps behind produces a different code.
  • One mistyped secret character produces a consistent but unusable code.

References