TOTP code generator
Generate time-based (TOTP) or counter-based (HOTP) one-time codes from a shared secret.
TOTP code generator
Paste a Base32 shared secret — the same one shown as text or hidden inside a QR code when you set up two-factor authentication — and this tool generates the current six-, seven- or eight-digit one-time code, exactly like an authenticator app. It follows RFC 6238 (TOTP, time-based) by default, with RFC 4226 (HOTP, counter-based) available as a mode switch for services that step a counter instead of the clock.
You can also paste a full otpauth:// URI instead of a bare secret. These are the strings authenticator apps read from a QR code — otpauth://totp/Issuer:account?secret=…&algorithm=…&digits=…&period=… — and this tool parses one automatically, filling in the algorithm, digit count and period from the URI so you don't have to copy each field by hand. Algorithm choices are SHA-1 (the default nearly every service still uses), SHA-256 and SHA-512; digit count is 6, 7 or 8; the period defaults to the standard 30 seconds but can be changed to match a nonstandard setup.
Set the verification window above zero to also see the codes for the steps just before and after the current one — useful when debugging clock drift between a server and a client, since a server that accepts a ±1 step window will validate a code your device shows a few seconds early or late. In HOTP mode, the same window shows the codes around a given counter value instead of a time step.
Everything runs through the Web Crypto API in your browser: the secret is read from a masked field, is never written to local storage and never leaves your device, exactly like the app it's standing in for. Copy the code, download it as a .txt file, or move it into another tool's input — there's nothing to upload and nothing to configure on a server.