Skip to content
hateitall

TOTP Code Generator

Test a 2FA setup or read codes from a secret you hold, with the maths checked against the standard.

Processed locallyIn: Base32 secret, otpauth:// linkOut: 6 to 8 digit code, otpauth:// link

Loading tool…

How to use totp code generator

  1. Paste a Base32 secret or a full otpauth:// link, or make a new random secret.

  2. Check the algorithm, digits and period: a link fills them in for you.

  3. Read the current code with the countdown, plus the previous and next codes.

  4. Copy the setup link or secret to add it to an authenticator app.

What this tool does

  • TOTP (RFC 6238) and HOTP (RFC 4226) with SHA-1, SHA-256 and SHA-512.
  • 6, 7 or 8 digits and any period from 1 to 3,600 seconds.
  • Reads otpauth:// links, including issuer and account labels, and builds them back.
  • Makes new 160-bit random secrets for setting up 2FA on your own service.

How the result is verified

On load, the tool runs all 18 test vectors from RFC 6238 appendix B (SHA-1, SHA-256 and SHA-512 at six timestamps) and shows whether every code matches the published one.

Frequently asked questions

Why do my codes not match my authenticator app?

Check three things: the clock on both devices, the algorithm (most services use SHA-1), and the digits and period. A secret copied with a missing character also gives wrong codes.

Is it safe to paste my 2FA secret here?

It is processed only in this tab and never sent anywhere. Still, anyone with the secret can make your codes, so do not paste it on shared computers and do not store it next to your password.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Random passwords with exact entropy, look-alike filter and one-of-each option

Length · Character sets→ TextLight on device

Random keys for JWT, HMAC, AES and sessions as hex, Base64 or Base64URL

Size in bytes→ HexLight on device

Decode JWT claims, see expiry, verify HMAC and public key signatures

JWT→ HeaderLight on device

RFC 4648, Base32hex and Crockford Base32 in both directions

Text · Hex bytes · Base32→ Base32Light on device