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

HOTP TOOLLocal processing

Use an existing setup key (spaces and hyphens are OK), or try the demo.

Use a QR image

Choose a PNG, JPEG or WebP image up to 8 MB. The image is read in your browser.

Advanced settings

Use the settings supplied by your service. Authenticator apps may not support every option.

Add a setup key to generate a code.

Your result will appear here

Using it

  1. Paste the secret (Base32) or an otpauth://hotp/... link, which carries the counter.
  2. Set the counter value the code should be calculated for. The first code of a new token usually uses counter 0.
  3. 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.

Technical sources