Tested tool guide
Tested browser tools
Checked August 16, 2026
What HOTP Counter-Based Code Generator does, with a checked example
An event number selects every result from the HOTP Counter-Based Code Generator. Supply the shared secret and counter value to calculate the RFC 4226 one-time password for that exact state. HOTP calculates HMAC-SHA-1 over an 8-byte representation of the counter, then turns a truncated portion of the result into decimal digits. The usual surprise is that waiting does nothing: unlike TOTP, an HOTP code stays reproducible until the counter advances, and a verifier with a different counter will reject it.
Worked example
A concrete input and expected output from the current implementation.
Input
Base32 secret: GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
Counter: 0
Digits: 6
->
The Base32 value represents the 20 ASCII bytes 12345678901234567890. For counter 0, dynamic truncation produces 1,284,755,224; reducing it modulo 1,000,000 gives 755224.