HOTP Generator
Enter a Base32 secret and a counter to calculate the HOTP code for that counter. Useful for hardware tokens, legacy systems and testing.
Runs in your browser. The key you paste and the codes it produces are not sent to the server. Security notes
Use an existing setup key (spaces and hyphens are OK), or try the demo.
Your result will appear here
When you need HOTP rather than TOTP
Most websites use time-based codes (TOTP). HOTP codes advance with a counter instead of the clock, and you’ll meet them on some hardware tokens, older enterprise systems and when testing an OTP implementation. If a service didn’t say otherwise, you probably want the TOTP generator.
Using it
- Paste the secret (Base32) or an
otpauth://hotp/...link, which carries the counter. - Set the counter value the code should be calculated for. The first code of a new token usually uses counter 0.
- Adjust digits or algorithm only if the system specifies them; the default is 6 digits with SHA-1.
Codes that stop working: counter drift
Each new code advances the token’s counter, but the server only advances when it accepts one. Generate many codes without using them and the token runs ahead of the server’s look-ahead window. Calculating codes for a range of counters here can show where the two sides are.
To check an implementation, compare with the published values on the test vectors page. Background: TOTP vs HOTP.