HMAC-Based One-Time Password
HOTP is a method for generating single-use passcodes used as an authentication factor. Each code is produced from a secret key shared between the user's device and the server, combined with a counter that advances each time a new code is generated. Because the code changes with every use rather than by time, it is described as event-based.
HOTP, defined in RFC 4226, is an event-based one-time password algorithm that derives OTP values from an HMAC computed over a shared secret key and an incrementing event counter (the moving factor). The HMAC output is truncated and reduced to a human-readable numeric code, typically of a configurable digit length. As a possession-based authentication factor, HOTP relies on the server and token remaining synchronized on the counter value; because the counter advances only on generation rather than with elapsed time, HOTP differs from the time-based variant (TOTP), which uses a time step as its moving factor. HOTP addresses the credential-verification (authentication) step and does not by itself define authorization or provisioning behavior; its security depends on protecting the shared secret and managing counter synchronization, and specific digit counts and hash choices depend on deployment configuration.
Why it matters
HOTP, standardized in RFC 4226, was one of the foundational open algorithms that made interoperable one-time password authentication possible across vendors and token types. Before such standards, OTP hardware and software were often tied to proprietary systems; HOTP defined a publicly specified way to derive single-use codes from a shared secret and a counter, enabling possession-based factors that any conforming server and token could implement. For IAM teams, this matters because it underpins a broad class of second-factor deployments and directly informs the design of its more widely used time-based sibling, TOTP.
Who it's relevant to
Inside HOTP
Common questions
Answers to the questions practitioners most commonly ask about HOTP.