Get the current 6 or 8 digit code from a Base32 secret or an otpauth link. The secret stays in this tab.
A TOTP code is a short number worked out from a shared secret and the current time, so the app and the server get the same digits without talking to each other. The tool follows RFC 6238. It divides the Unix time by the period, 30 seconds by default, and the whole number that results is the step counter. It signs that counter with HMAC, using SHA-1, SHA-256 or SHA-512 and your secret as the key. Then it applies the dynamic truncation of RFC 4226 section 5.3: the last four bits of the result choose an offset, four bytes from that offset become a 31-bit number, and the last 6 or 8 digits of that number are the code. The code changes when the step changes, which the countdown shows. The next code is the one for the following step.
The secret is written in Base32, defined in RFC 4648: the letters A to Z and the digits 2 to 7. Spaces, hyphens, lower case and trailing equals signs are ignored, so a secret shown as groups of four letters works as it is. You can also paste the whole otpauth link that a QR code holds, such as otpauth://totp/Example:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example&digits=6. The tool reads the issuer, the account, the algorithm, the digits and the period from it and sets the options for you. A link for counter-based codes (HOTP) is refused with a message, because this tool makes time-based codes. If a link names an algorithm or a period the tool does not offer, the default is used. Make a test secret creates 20 random bytes, the 160 bits that RFC 4226 recommends, with your browser's random generator.
The check box compares a code you typed with the code for the previous step, the current step and the next step. Servers allow this one-step window because a phone clock can be a few seconds off and because people type slowly. The result says which step matched: the current one, the previous one (a code that has just expired) or the next one (a clock that runs ahead). A code of the wrong length, or one that matches none of the three, gets a plain no-match message with the settings to check. A mismatch most often means a different algorithm, 8 digits instead of 6, a 60 second period, or a secret copied with a wrong character. The tool is tested against the RFC 6238 Appendix B values for SHA-1, SHA-256 and SHA-512 and the RFC 4226 Appendix D values.
The work is done by your browser's Web Crypto in this tab. The secret is not uploaded, not saved in storage and not put in the page address, so there is no link that carries it and a reload clears it. The page counts visits with Google Analytics but sends nothing you type. Even so, treat it as a testing tool: use it for the test account of your own app, to check a login flow, or to recover a code from a secret you already own. A secret for a real bank or work account is better kept in an authenticator app, because anyone who reads this screen or your clipboard holds a way into the account. It needs a browser with Web Crypto on an https page. The example secret shown on opening is the public RFC test key, not a real account.
Paste the Base32 secret, for example JBSWY3DPEHPK3PXP, into the box. With the defaults of SHA-1, 6 digits and 30 seconds the page shows the current code and counts down to the next one. Match the options to your app if it uses others.
Check four things: the algorithm (SHA-1 is the default, a few services use SHA-256 or SHA-512), the digits (6 or 8), the period (30 or 60 seconds) and the secret itself. Pasting the otpauth link sets all of them from the link. A device clock that is more than 30 seconds off also breaks codes.
The secret stays in this tab: it is not sent to a server, not stored and not added to the address. Still, use this for test accounts. A real account secret belongs in an authenticator app, since anyone who sees your screen or clipboard can then make valid codes.
The path holds the issuer and account, such as Example:alice@example.com. The query holds secret, and optionally issuer, algorithm (SHA1, SHA256, SHA512), digits (6 or 8) and period (30 or 60). Only the secret is required; the rest default to SHA1, 6 and 30.
The check accepts three steps: the previous, the current and the next. At the 30 second default that covers about 90 seconds of clock difference. Many servers use the same one-step window, but a stricter server may accept only the current step.
No. It makes time-based codes (RFC 6238). A link that starts with otpauth://hotp is refused with a message. The counter method of RFC 4226 uses the same truncation but a counter you increase by hand instead of the clock.