Use a test Base32 secret to compare authenticator settings and generated codes. Choose TOTP for a clock-based code or HOTP for a specified counter.
Runs locally in your browserCompare the generated value with your implementation using a disposable test secret. Clock drift, secret storage, recovery codes, rate limits, and account recovery still require server-side controls.
This workbench turns a Base32 secret into the one-time code an authenticator app would show, using the algorithm, digit count and period or counter you select. It also prints the otpauth:// provisioning URI that a QR code would carry.
The HMAC is computed in the tab with Web Crypto. The tool itself sends no request while it works, so the secret and the generated code stay in the browser.
The code is an HMAC over the counter in use: the counter is signed with the secret, the last byte of the signature selects a 4-byte window (dynamic truncation), and that value is reduced modulo 10^digits. TOTP is the same function with the counter taken from Unix time divided by the period, which is why a TOTP code changes on its own while an HOTP code waits for the next counter.
The tool matches the published test vectors. With the RFC secret, HOTP counters 0 to 5 return 755224, 287082, 359152, 969429, 338314 and 254676. A clock inside the RFC time step that contains T=59 returns 94287082 with SHA-1 and 8 digits, and the later vectors (T=1111111109 and T=20000000000) return 07081804 and 65353130.
The review restates the parameters that were used and repeats two server-side duties: an HOTP counter has to be incremented and stored atomically by the verifier, and a secret with fewer than 20 decoded bytes is too short for production use. A period other than 30 seconds and SHA-256 or SHA-512 are valid, but fewer apps and servers accept them.
Nothing here validates a code that someone typed in, measures clock drift on the server, or proves that the secret is the one your account uses. Compare a generated code with the implementation that will verify it, and treat the enrolment flow of the authenticator as the source of truth.
The URI follows the otpauth:// key format — secret, issuer, algorithm (SHA1, SHA256 or SHA512), digits, and period or counter — which is the string a QR code encodes. The secret is written back in Base32 without spaces or padding, and the label joins the issuer and the account name.
The HMAC and the URI are produced inside the tab and the tool sends no request, so the secret and the resulting code never leave the browser. Use a disposable test secret while comparing implementations, and keep production seeds in the systems that are allowed to store them.