TOTP Generator (RFC 6238)

Enter a base32 secret or an otpauth:// URI to get the current six-digit code and the next one, with a countdown. Digits, period and SHA algorithm can be changed.

Use the tool

Why this tool exists

Developers testing two-factor login need to know what code an authenticator should show for a given secret, and support teams sometimes need to confirm that a secret works. A phone app is awkward for that, especially when you are scripting or debugging an implementation.

This page implements RFC 6238 with the browser WebCrypto API. Paste the secret or a full otpauth link and it reads digits, period and algorithm from the link, then shows the current code, a progress bar and the next code. You can also generate a random test secret. Use it for testing and learning, and do not paste the secret for an account you care about into a page you do not trust.

How to use it

  1. Paste a base32 secret or an otpauth:// URI into the secret box.
  2. Choose digits, period and algorithm if they differ from the usual 6, 30 seconds and SHA-1.
  3. Read the current code and the countdown bar.
  4. Use Generate random secret to create a test secret.

Frequently asked questions

Will it match Google Authenticator?

For standard settings of 6 digits, a 30-second period and SHA-1, yes, provided your device clock is correct. Services that use other digits or algorithms need those values set.

Why does my code not work?

Most often it is clock drift, a wrongly copied secret or different parameters. Check your system time, the base32 characters and the digits, period and algorithm of the service.

Is it safe to enter a real secret?

The calculation is local and nothing is uploaded, but a TOTP secret is as sensitive as a password. Use test secrets here, and keep real ones in an authenticator you trust.

What is the default secret?

The page loads with an example secret so you can see a code immediately. Replace it with your own or generate a random one.