Antpact Toolbox
中文
Home › Utilities & Developer › TOTP Generator

TOTP Generator

Generate 6/8-digit TOTP codes from a secret, with countdown and QR import.

Privacy: this tool runs entirely in your browser — files are never uploaded, and data is gone when you close the page.

How to use

  1. Enter your Base32 secret (or hit "Random" to create one).
  2. Pick digits, period and algorithm (default 6 / 30s / SHA1).
  3. Read the code for your login, or scan the QR to import the secret into an authenticator app.

FAQ

Can I use the generated code to log in?

Yes — as long as secret, digits, period and algorithm match the service, the code is identical to what Google Authenticator produces.

Why is my secret invalid?

TOTP secrets are Base32 (letters A–Z and digits 2–7). Common mistakes are confusing O with 0, or pasting extra spaces.

SHA1 or SHA256?

Most services (Google, GitHub, Microsoft) use SHA1 with 6 digits and 30 seconds. Only switch to SHA256 if the service explicitly requires it.

Is my secret uploaded?

No. Everything is computed locally in your browser — neither the secret nor the codes are sent anywhere or stored.

What is the QR code for?

It encodes the otpauth:// URI. Scan it with an authenticator app to add the secret, and the app will keep generating the same codes.

About this TOTP Generator

Full RFC 6238 implementation: Base32-decode the secret, HMAC over the time counter, then dynamic truncation and modulo. SHA1/SHA256 and HMAC are pure JavaScript, verified against the official RFC 6238 test vectors. Your secret never leaves the browser.