Paste an otpauth:// link and the secret, algorithm, digits and period are filled in for you. Spaces, hyphens and padding in the secret are cleaned up automatically.

Enter a secret to start the timer

The secret takes part in one HMAC computation inside this tab: nothing is uploaded, nothing is written to localStorage, and reloading clears it. "Check device clock" sends a single HEAD request to this site and carries no secret.

How the code is computed

RFC 6238 slices time into fixed-length steps and HMACs the step number with your secret; RFC 4226 dynamic truncation then takes four bytes of that digest and turns them into decimal. The step number changes, the code changes — every 30 seconds by default. That is also why this works offline: nothing is being looked up, your phone app and this page run the same public algorithm.

T      = floor(unixSeconds / period)
M      = HMAC(key, int8be(T))
offset = M[len-1] & 0x0f
code   = ((M[offset] & 0x7f) << 24 | M[offset+1] << 16
          | M[offset+2] << 8 | M[offset+3]) % 10^digits

Five questions worth answering

Online TOTP Code Generator

You changed phones, reinstalled your authenticator, or simply want to read one code on your desktop - and the answer is "install our app". This page is for exactly that one-off need.

Paste the Base32 secret, or drop in the otpauth:// link the site gave you, and the code appears immediately, rotating every 30 seconds with a countdown beside it. Algorithm, digit count and period are adjustable, because implementations are not uniform. Everything is computed in your browser: the secret never reaches a server and is never written to local storage.

Features

How to use

  1. Paste the secret into the field, or paste the whole otpauth:// link.
  2. The large digits are the current code; the bar empties and the code rotates.
  3. Click the digits to copy them (or use the copy button below).
  4. If a site keeps rejecting the code, hit the clock check first and see how far off you are.

FAQ

Is it safe to type my secret here?

At the code level: the HMAC is computed with the browser native Web Crypto API, the secret lives only in this page memory, there is no upload path and nothing is written to local storage. You can read the JavaScript this page loads and verify that yourself. Be clear about the limit though: any web page can be tampered with or have scripts injected by an extension, so do not enter a secret on a shared computer or an untrusted network. For daily use, an app on your phone is still the better answer.

The code is rejected. What is the most likely cause?

In order of likelihood: the device clock is off (by far the most common), the wrong algorithm (a few sites use SHA-256), a digit count or period mismatch, or a character missing from the secret. The first three are diagnosable right here - start with the clock check.

Do I need to strip the spaces and hyphens?

No. Base32 is usually displayed in groups of four with spaces; spaces, hyphens and padding are removed automatically.

Does it support HOTP?

No, and it says so explicitly when you paste a hotp link. HOTP is counter based rather than time based: every use increments a counter, so it needs counter input and state synchronisation. Cramming that into this page would mostly produce wrong codes.

Should the code match what my phone app shows?

Within the same time step, with identical parameters, yes - both run the same public algorithm. If you copied a code and it failed immediately, you probably crossed the 30 second boundary; watch the countdown and try again.

Does it work offline?

Yes. Computing a code needs no network at all; only the clock check makes a request, and that one goes to this site.

Related tools & reading

Feedback

This site is front-end only — no backend, no accounts — so feedback goes to GitHub Issues, Discussions, or email.

Paste it into the issue or email to help track it down — it never includes anything you typed

Also:Browse existing issues · Email feedback (no GitHub account needed):278975598@qq.com