TOTP generator: two-factor codes from a secret key or otpauth link

Paste a secret key or an otpauth:// link and watch the six-digit code and its countdown, updated live in your browser tab.

  • Free, no sign-up
  • Your files and data stay on your device
  • No watermarks or limits

0 bytes uploaded. Everything happens in this tab.

How to use it

  1. Paste the Base32 secret, or the whole otpauth:// link, into the “Secret key (Base32) or otpauth:// link” field. “Generate a random secret” creates a new one for testing.
  2. Read the code, which is shown in two groups, and watch the bar and the “New code in N s” line for the time left.
  3. Press “Copy code” to copy it without the space. Open “Advanced settings” to change the Algorithm, Digits (6 or 8) or Period (seconds) when the service uses other values.

Example

RFC 6238 test vector (SHA-1, 8 digits, time 59 seconds after 1970-01-01):

Secret:  GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
Code:    94287082

The prefilled demo secret JBSWY3DPEHPK3PXP gives 282760 in the first 30-second window after the Unix epoch and 996554 in the second, with the default 6 digits.

About this tool

Time-based one-time passwords, or TOTP, are the codes used by most authenticator apps. The service and the app share a secret once, usually through a QR code. After that, both compute a code from that secret and the current time, in steps of 30 seconds by default. The tool follows RFC 6238 and RFC 4226: it reads the secret as Base32 (letters A to Z and digits 2 to 7, spaces, dashes and lowercase are ignored), counts the 30-second periods since 1970 and runs an HMAC.

When you paste an otpauth:// link, the tool reads the secret, the algorithm, the number of digits and the period from the link and shows the issuer next to the countdown; the Advanced settings are then ignored. With a plain secret you choose them yourself. This is handy for testing a login flow you are building, for checking that a secret you were given produces the code the server expects, or for understanding how 2FA works.

Please be careful with real accounts. The code is computed in this tab, and the page sends nothing, but your browser, its extensions and the device itself are outside our control. If the same computer holds your password and your 2FA secret, the second factor protects much less. Typing a secret here is not a substitute for a proper authenticator app, a hardware key, a password manager or the backup codes the service gave you. Also, the code depends on your device clock: if it is off by more than a short moment, the service will reject the code. The demo secret is public, so never use it to protect anything.

Frequently asked questions

Why does my code not work on the website?

The most common cause is a wrong clock on your device or on the server, or different settings. Check the algorithm, the digits and the period. Most services use SHA-1, 6 digits and 30 seconds.

What is the difference between the secret and the otpauth link?

The link contains the secret plus its settings and a label, for example the service name. The secret alone is just the key, so the tool assumes the defaults unless you change them in Advanced settings.

Is it safe to paste the secret of my real account?

The code is calculated locally and nothing is sent, but it is still your decision about who can see your screen and what runs in your browser. For accounts you cannot afford to lose, use a trusted authenticator app and keep the service’s backup codes.

Does the tool save the secret?

It does not store it anywhere. When you close or reload the tab, it is gone, so keep your own copy in a safe place if you need it.

Can it scan a QR code?

No. If you have a QR code, use the text secret or the otpauth link that most services show as an alternative next to it.

Often used next