Skip to main content

TOTP Code Generator & Tester

TOTP Code Generator & Tester is a local diagnostic tool for time-based one-time passwords, the six- or eight-digit codes used for two-factor authentication.

Algorithm
SHA-1 is included for TOTP compatibility, not as a general hashing choice.
Digits
Period

Enter a Base32 secret, pick the algorithm, digits and period, then start to see the current TOTP code and its countdown.

This tool is intended for testing and troubleshooting TOTP configurations. Do not use it as your primary authenticator or as a place to store important 2FA secrets.

Anyone who has the same TOTP secret can generate the same codes.

Codes depend on your device's current clock. This tool does not sync time.

Processed locally in your browser

How to use it

  1. Paste your Base32 TOTP secret (use Show secret to check it)
  2. Choose the algorithm (SHA-1, SHA-256 or SHA-512), the digits (6 or 8) and the period (30 or 60 seconds)
  3. Click Start TOTP to see the current code and the countdown
  4. Copy the code; it refreshes automatically at the end of each period. Use Stop or Clear when done

It implements RFC 6238 (TOTP) on top of RFC 4226 (HOTP): you paste a Base32 secret, choose the hash algorithm (SHA-1, SHA-256, or SHA-512), the number of digits (6 or 8), and the period (30 or 60 seconds), and the tool shows the current code together with a countdown to the next one. SHA-1 is offered because RFC 6238 still references it widely for TOTP compatibility, not as a general hashing recommendation. Each code is derived by taking an HMAC of the current time counter — floor(unix time / period) — with your secret, then applying the RFC 4226 dynamic-truncation step. The codes are computed entirely in your browser using the Web Crypto API and your device's own clock; the tool does not synchronise time, so a code can differ from your authenticator app if the two clocks disagree. This tool is for testing and troubleshooting TOTP configurations. It is not a replacement for an authenticator app, not a backup for your 2FA secrets, and not a place to store account credentials: the secret lives only in the page while it is open and is never uploaded, logged, or stored. Anyone who holds the same TOTP secret can generate the same codes, so treat the secret with care. Unlike the HMAC Generator, which returns a single static keyed authenticator for a message, the Secure Token Generator, which produces random bytes, the JWT Decoder, which inspects an existing token, or the Password and Passphrase generators, which create new credentials, this tool turns a shared time-based secret into the changing numeric code expected by a 2FA verifier.

FAQ

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.