TOTP

TOTP vs HOTP: When Each One Actually Gets Used

TOTP dominates consumer 2FA, but HOTP hasn't disappeared — it's still the standard behind many hardware tokens and offline scenarios. Here's a deeper look at how the two differ in practice and why each one is still the right tool for specific situations.

Nency
Published Sep 18, 2026
4 min read

Two Standards, One Shared Foundation

TOTP and HOTP are both defined by IETF standards — RFC 4226 for HOTP and RFC 6238 for TOTP — and TOTP is explicitly built as a small extension of HOTP. Both generate a short numeric code from a shared secret key using HMAC hashing. The only structural difference is what drives the calculation: HOTP uses a counter that increments by one each time a code is generated, while TOTP uses the current time, divided into 30-second steps, as that counter instead. For the full mechanics of the TOTP side of this, see How TOTP Works Under the Hood.

Why TOTP Won Out for Everyday Consumer 2FA

Time is a variable both sides of the exchange already track independently and continuously — your device's clock and the server's clock are both always running, so they naturally stay roughly in sync without any coordination step. A counter, on the other hand, only advances when a code is actually generated. If you generate a code on your device but never submit it (say, you copy it and then get distracted), the counter on your device has moved forward while the server's counter hasn't, and the two fall out of sync. Repeated small mismatches like this eventually push HOTP-based systems outside their tolerance window, requiring a resynchronization step. TOTP sidesteps this entirely because time doesn't depend on how many codes were actually used — it just keeps moving forward at the same pace on both sides.

Where HOTP Is Still the Right Choice

HOTP hasn't been abandoned — it's simply used in narrower, more specific situations where its counter-based design is actually an advantage rather than a liability:

Hardware Tokens Without a Reliable Clock

Small, cheap hardware OTP tokens sometimes lack a precise internal clock or a way to keep one accurately synced over their multi-year lifespan without a battery replacement affecting timekeeping. A counter-based HOTP token sidesteps clock-drift problems entirely, since there's no time dependency to drift in the first place — the counter only moves when a button is physically pressed.

Fully Offline, Print-and-Use Scenarios

Some legacy systems print a numbered list of one-time codes in advance (essentially a physical HOTP sequence), where the "counter" is simply which entry on the printed list you're currently on. This works precisely because there's no time element to worry about keeping accurate.

Event-Driven Rather Than Time-Driven Actions

In certain systems, a code needs to be generated on-demand for a specific discrete action rather than tied to a rolling time window — HOTP's "generate exactly when needed, valid until used" model fits that pattern more naturally than a code that might expire mid-action.

Side-by-Side Comparison

PropertyHOTPTOTP
Counter variableIncrementing integerCurrent time, in 30-second steps
Code validityValid until used (no expiry)Expires after ~30-60 seconds
Sync riskCounter drift if codes generated but unusedMinor clock drift, tolerated within a small window
Common use caseHardware tokens, offline/print scenariosMobile and web authenticator apps
RFCRFC 4226RFC 6238

Does This Distinction Affect You as a User?

For the overwhelming majority of accounts you'll ever protect with 2FA — email, social media, banking apps, work SSO — the service is using TOTP, and a browser-based authenticator like AuthBro or a mobile app handles it transparently. You'll only run into HOTP directly if you're issued a physical hardware token by an employer or a specific financial institution, in which case the device itself handles the counter logic and you simply press a button to get your next code.

HOTP didn't lose to TOTP on security grounds — it lost on convenience grounds for the specific case of software running on internet-connected, clock-aware devices. Where that assumption doesn't hold, HOTP is still the more practical choice.

Sources

Did you find this helpful?
78

Frequently Asked Questions

Not inherently — both use the same HMAC-based cryptography. The practical difference is operational: HOTP codes don't expire until used, which is a convenience tradeoff for certain hardware, not a cryptographic weakness.
If a code is generated but never submitted, the counter on the token advances without the server's counter advancing to match, causing drift. Most systems allow a look-ahead window to tolerate a few missed codes before requiring manual resynchronization.
Yes, technically — both use the same underlying HMAC algorithm, differing only in what drives the counter. Most consumer-facing apps default to TOTP because nearly all modern services use it, but the standard itself supports both.
N

About The Author

Nency

Author is a software developer and technical contributor at AuthBro. They specialize in building performance-oriented browser productivity systems and writing developer guidelines.

Related Guides

Explore additional resources on 2FA security and authentication.