Turn a Base32 secret — or the whole otpauth:// URI from a QR code — into the six-digit code an authenticator app would show, with a live countdown to the next one. It follows RFC 6238 and is verified against all six of the specification's published test vectors rather than against a screenshot, including the case that catches most implementations: one code in eight comes out wrong if the sign bit is not masked during truncation. The previous and next codes are shown too, since most servers accept one step either side to tolerate clock drift. Your secret stays in the page and is never sent anywhere. Use this for your own accounts — testing a 2FA integration, or getting in when your phone is not to hand.
| Setting | Usual value | Also seen |
|---|---|---|
| Digits | 6 | 8 |
| Period | 30 seconds | 60 |
| Algorithm | SHA-1 | SHA-256, SHA-512 |
| Drift allowance | ±1 step | Server-dependent |
It stays in the page — you can confirm with your browser's network tab that nothing is sent. But be clear about what the secret is: on its own it generates codes forever, so it is a second factor in plain text. Use this for your own accounts, and prefer a proper authenticator app for day-to-day use, where the secret lives in device storage rather than a browser tab.
Almost always the clock. TOTP is time-based, so a device a minute out produces a different code; check your system time is syncing. Otherwise check the digits, period and algorithm — a few services use 8 digits, 60 seconds or SHA-256 rather than the usual 6, 30 and SHA-1.
Because most servers accept one step either side to tolerate exactly that clock drift. If the current code is rejected and you are near a boundary, the adjacent one often works.
Base32 in any case, with or without spaces, hyphens or padding — and the full otpauth:// URI from a QR code, from which the issuer, digits, period and algorithm are read automatically.
Base32 has no 0, 1 or 8 — they were left out because they are confusable with O, I and B. If your secret contains one it was almost certainly mistyped, and the tool names the character.
Yes, and it is tested against the specification's own vectors for SHA-1 at 8 digits, which is a stronger check than comparing against one app. SHA-256 and SHA-512 are supported too.
For a quick check, yes. As a permanent arrangement, no — a browser tab is not where a long-lived secret belongs, and an app keeps it out of anything that can read the page.
TOTP is HMAC over a counter, and the counter is the current Unix time divided by the period. The secret is Base32 — accepted here lowercase, spaced in groups of four, and with or without padding, because that is how services actually hand them out, and rejected with the offending character named when it contains 0, 1 or 8, which are excluded from the alphabet precisely because they look like O, I and B. Two details decide whether an implementation is correct. The counter is written as eight big-endian bytes through a DataView rather than with bit shifts: JavaScript's bitwise operators truncate to 32 bits, and a Unix timestamp divided by 30 already needs 31, so a shift-based version works until roughly 2038 and then silently produces wrong codes. The dynamic truncation then takes the low four bits of the digest's last byte as an offset, reads four bytes from there, and masks off the top bit. Skipping that mask makes one code in eight come out negative, and JavaScript's modulo of a negative number is negative — so the bug appears as an occasional code with a minus sign rather than as a consistent failure, which is exactly how it survives a casual test. This implementation is checked against all six RFC 6238 test vectors rather than against a screenshot of an authenticator app. The HMAC itself is the browser's Web Crypto, shared with the site's other hashing tools. The `otpauth://` URI a QR code contains is parsed too, including the issuer and the digits, period and algorithm parameters, because retyping a secret out of a QR code is where mistakes happen. The code refreshes on its own and shows the seconds remaining; the previous and next codes are shown as well, since most servers accept one step either side to tolerate clock drift. The secret stays in the page and is never sent anywhere — which is the only acceptable arrangement for a value that is, by itself, a second factor.