One Time Password (OTP): What It Is, the Three Kinds You Actually Meet, and Which One Your Bank Trusts
One Time Password (OTP): What It Is, the Three Kinds You Actually Meet, and Which One Your Bank Trusts
Somewhere between your password and your money sits six digits that did not exist a minute ago and will not exist a minute from now. You did not choose them. You cannot memorise them. You cannot reuse them. And yet entire banks, email providers, and governments trust those six digits more than they trust the password you spent years picking.
That is the one-time password. It is the most successful security idea most people never think about, and the most misunderstood one, because three completely different mechanisms all answer to the same three letters. This guide sorts them out, shows you the maths running underneath one of them — I ran it myself rather than quoting it — and reports two live tests from this morning, one of which failed in a way that tells you more than a success would.
The 30-second answer: a code that dies on purpose
A one-time password is a short code, usually four to eight digits, that is valid for exactly one login or one transaction, and then becomes useless — either because you used it, or because its time ran out. That is the whole definition, and the "one-time" part is doing all the work.
A normal password is a secret you reuse. Every time you type it, you hand a copy of it to a server, a network, and whatever is listening in between. If any one of those copies leaks — a breach, a phishing page, a keylogger — the attacker can use it forever, from anywhere, until you change it. An OTP flips that around. The code is generated on demand, for one job, and its value dies with the job. Steal it five minutes late and you have stolen nothing. Steal it in time and you still need to be the person the code was sent to, in the window before it expires, before the attempt limit locks the box.
That is why OTPs sit on top of passwords instead of replacing them. The password proves you know something. The code proves you also control something — your phone, your inbox, or your authenticator app — right now. One factor can be phished. Both at once, in the same minute, is a much harder job.
People meet OTPs under a dozen names: verification code, one-time passcode, 2FA code, SMS code, authenticator code. Most of the time they are the same thing wearing different clothes. The differences that matter are not the names. They are how the code is made and how it reaches you.
I checked the maths, and the maths checks out
The most interesting OTP is the one nobody sends you. Open an authenticator app — Google Authenticator, Microsoft Authenticator, Authy, 1Password — and it shows a six-digit code that changes every 30 seconds, with no message arriving, no network involved, and no server contact. Your phone and the service agree on the same code without ever talking to each other. That sounds like a trick. It is arithmetic, and the arithmetic is public.
The standard is RFC 6238, published by the IETF in May 2011. It defines TOTP, the time-based one-time password: take a shared secret that both sides know, take the current time cut into 30-second steps, run the two through HMAC-SHA1, and squeeze the result down to six or eight digits. Both sides run the same calculation with the same secret and the same clock, so they land on the same number. The code is never transmitted anywhere, which is why it works in airplane mode.
I did not take that on faith. RFC 6238 publishes test vectors — fixed secrets and timestamps with the exact codes they must produce — so I implemented the algorithm from scratch in Python and checked it against the standard's own table. The test secret is the ASCII string "12345678901234567890", the time step is 30 seconds, and the codes are eight digits. My implementation matched all six of the standard's SHA-1 vectors exactly:
- At 59 seconds past the epoch, the code must be 94287082. Mine produced 94287082.
- At 1,111,111,109 seconds, it must be 07081804 — leading zero included. Mine matched.
- At 1,111,111,111 seconds, it must be 14050471. Mine matched.
- At 1,234,567,890 seconds, it must be 89005924. Mine matched.
- At 2,000,000,000 seconds, it must be 69279037. Mine matched.
- At 20,000,000,000 seconds, it must be 65353130. Mine matched.
Then I generated a live code for the same test secret with two independent implementations of the same formula. At 11:13 UTC on November 20, 2026, both agreed on 865177. That code expired 30 seconds later, as it should. Same secret, same window, same code on both sides; a different code the moment the window turns over. That is the entire trick: a shared secret, a clock, and a hash.
The practical lesson is the one people learn the hard way. If your authenticator codes keep failing, the prime suspect is your phone's clock, not the app. A phone running more than a minute fast or slow computes codes for the wrong 30-second step, and no amount of rescanning the QR code fixes it. Turn on automatic date and time, and try again before doing anything else. And treat the QR code you scan at setup like a password: anyone holding it can generate your codes forever, because it contains the shared secret itself.

TOTP vs HOTP: a clock against a counter
TOTP has an older sibling, and confusing the two is how people buy the wrong hardware token. HOTP — HMAC-based one-time password, standardised in RFC 4226 in 2005 — works the same way, except the moving part is a counter instead of a clock. Every time you press the button on a hardware token, the counter goes up by one, and the code is computed from the secret and that counter. The server keeps its own copy of the counter and checks the code against it.
The counter version has one honest weakness: desynchronisation. Press the button ten times in your pocket without logging in, and your token's counter is ten ahead of the server's. The server then has to guess how far ahead you are, and most implementations give up after a look-ahead window of a few dozen codes. TOTP solved this by replacing the counter with the time. Clocks drift by seconds; counters drift by however many times someone fidgeted with the button. That is why nearly every authenticator app and every modern hardware key uses TOTP by default, and why HOTP survives mostly in older hardware tokens and industrial systems.
The names are worth spelling out, because the search results mix them up constantly. TOTP stands for time-based one-time password. HOTP stands for HMAC-based one-time password, after the HMAC construction it is built on. An "OTP" on its own usually means either of these, or the third family — a code a server generates and sends you, which is what the rest of this guide is about.
If you want the full mechanics of the authenticator side — the QR code, the otpauth:// URI, the expiry test with and without a grace window — our guide to OTP scanners runs the experiment end to end. And if you want to test a TOTP setup yourself, the method is in our OTP test guide: generate a code, check it against a second source with the same secret, and compare two adjacent 30-second windows before you close the setup page.
The email test: Notion would not even send the code
App codes are only one flavour. The OTP most people actually meet is the one that arrives by email: six digits in your inbox, valid for five or ten minutes, sent when you sign up or sign in. And the part nobody tells you is that the code's journey has two gates, not one. The service has to accept your address before it will send anything at all — and a temporary address is exactly the kind of address services are built to distrust.
I tested that gate this morning, November 20, 2026, with a fresh temporary inbox. Opening tempomailusa.com generated the address testfix123@tempomailusa.com instantly, no signup, no form, with the inbox showing zero messages and "Expires in 28d 18h 58m". I took that address to Notion's signup page, which asks only for a "Work email" — no name, no password first — entered it, and clicked Continue at about 11:17 UTC.
Notion's answer, in red under the Continue button, was:
There was a problem signing up.
The page stayed on the signup form. No code-entry screen appeared. I went back to the temp inbox about a minute later, closed an ad overlay, clicked Refresh: still zero messages, "This inbox is empty. Waiting for messages..." No email from Notion arrived, because no email was sent. There is no delivery time to report, no sender to name, and no code format to describe — the test ended at the front door.
I am not going to claim I know exactly why. The message is generic, and a generic message is all I have. The honest read is the same one this morning's earlier test reached for a different service: disposable domains are exactly the kind of address an anti-abuse system is built to distrust, and Notion's system distrusted this one without explaining itself. It may also have been a transient error. What is unambiguous is the practical result: a temp-mail address could not start a Notion account that morning.
That failure is useful, because it draws the line in the right place. A temporary inbox is a receiver, not a skeleton key. It is excellent for services that accept disposable addresses, and it tells you the truth quickly when they do not — an empty inbox after a failed signup means nothing was sent, not that the inbox is broken. The mistake is to keep hammering the same address at the same form. If one domain fails, try one other domain. If that fails too, the service has made its policy clear, and the honest move is a spare real address, not a third disposable domain. Our guide to what disposable email actually is draws that boundary in full, including the rule that matters most: never let a code for anything you must recover land in an inbox that expires.

OTP in banking: the code that guards your money
Nowhere is the OTP more serious than in banking, and nowhere is the confusion around it more expensive. "What is OTP in banking" is one of the most searched versions of this question, and the answer is narrower than people think.
A banking OTP is the same mechanism with higher stakes and shorter patience. When you log in to your bank, add a payee, or confirm a payment, the bank sends a code — usually by SMS, sometimes by email or through its own app — and that code authorises one specific action, not your account in general. The payment-confirmation version has its own name in card payments: 3-D Secure, the "Verified by Visa" or "Mastercard SecureCode" step, where the code you type approves that one transaction, for that one amount, to that one merchant. A stolen code authorises nothing else, and an expired one authorises nothing at all.
Three banking realities are worth knowing before you need them. First, banks send codes for actions, not on a schedule. If a code arrives when you did nothing, somebody just tried to do something in your name — treat it the way our verification code guide describes: do not enter it anywhere, change the password from a device you trust, and check for unfamiliar sessions. Second, the code's short life is deliberate. A six-digit code has a million possible combinations, and the bank's attempt limit — typically three to ten wrong guesses before the code dies — is what makes guessing pointless. The annoyance of a code expiring while you hunt for it is the security working as designed. Third, and most important: your bank will never call, text, or message you asking for the code. Never. The code proves you control the account. Anyone asking you to read it back to them is asking you to hand them the account, and the request itself is the proof they are not your bank.
One more banking detail, because it catches people out: many banks refuse to send OTPs to disposable or temporary email addresses at all, and some refuse to send them to VoIP numbers. If your bank's code never arrives, the address type is the first thing to suspect — and for banking, the answer is not to fight the blocklist. Use a permanent address and a real number, protected by an authenticator app of their own. Money on an unrecoverable inbox is money you cannot defend.
The four delivery routes, ranked honestly
Codes reach you four ways, and the route decides how safe the code is and how likely it is to go missing. Ranked from strongest to weakest, with the trade-offs stated plainly:
- Authenticator app (TOTP). Nothing is sent anywhere, so nothing can be intercepted in transit and nothing can be delayed. The code is computed on your device from a secret and the clock. This is the strongest of the four for everyday use, and the one I recommend for anything that holds money or your identity. The cost is real: lose the phone without backup codes and you are locked out until support helps you.
- Email. The code goes to your inbox. Easy to find, easy to search, works on any device where you can open your mail. But an email code is only as secure as the inbox it lands in, which is why your email account itself deserves the strongest protection you have. If your email is protected by SMS codes alone, the whole chain is only as strong as the weakest link in it.
- SMS. The most common route, and the weakest. Convenient — nothing to install — but SMS was never built for secrets. Messages can be intercepted, and a SIM-swap attack can move your number to an attacker's phone. SMS codes are fine for a forum signup. I would not rely on them as the only protection on a bank account or a primary email account.
- Voice call. Some services read the code aloud over a phone call. It exists mostly as a fallback for poor signal, landlines, or phones that cannot display texts. Slow, awkward, and only worth using when the other three are unavailable.
A fifth route is appearing more often: passkeys and push approvals, where you tap "yes, it's me" on your phone instead of typing digits. They solve the same problem without a code at all, and they are gradually replacing codes on the biggest platforms. Until they finish taking over, the code is what you will keep meeting — and the full version of this ranking, including what to do when a code never arrives, is in our verification code guide.
Why the code dies so fast (and why that is the point)
People experience OTP expiry as a bug. It is the feature. A six-digit code has exactly one million combinations, from 000000 to 999999, and a computer could try all one million in seconds if nothing stopped it. What stops it is the combination of a short life and a small attempt limit: a typical service gives the code five to ten minutes and locks the entry box after a handful of wrong guesses. Guessing blindly inside ten tries, an attacker's chance is ten in a million — 0.001%. Stretch the expiry to an hour and remove the attempt limit, and the same code becomes a sitting target.
That is also why requesting a second code kills the first. Two live codes for the same account would double the attack surface for no benefit. If you request a resend, use the second code — the first is already dead, and typing it in only burns one of your attempts. And it is why a code that "just worked a second ago" genuinely stops working: for TOTP, the 30-second window turned over; for email and SMS codes, the minutes ran out. The system is not being difficult. It is keeping the window small enough that stealing the code is not worth the effort.
Passkeys are coming for the OTP — slowly
The honest forecast is that the OTP's days are numbered, but the number is large. Passkeys — the FIDO2/WebAuthn standard behind "sign in with your face/fingerprint" on Google, Apple, and Microsoft accounts — remove the shared secret entirely. There is no code to intercept, no code to phish, and nothing to type. Every major platform now supports them, and every major platform still falls back to OTPs the moment anything goes slightly wrong: a new device, a lost phone, an old browser, an account created before passkeys existed.
That fallback is the OTP's future for the next few years. It becomes the recovery method rather than the front door — the thing you use when the modern method fails, which is exactly when you are most stressed and most likely to be phished. So learn the OTP properly anyway. The code that guards your recovery path guards everything, and the scams that want it are not going anywhere. Our email OTP free service API guide covers the other side of that future: what it costs developers to send these codes, and why the free tiers that promise them for $0 are narrower than their landing pages suggest.
The one rule that matters: never read your code to anyone
Every version of the OTP scam follows the same script, because the code is a bearer token: whoever holds it, holds the account. Create urgency, impersonate trust, ask for the digits.
The most common version is the "support" call or message: your bank, your email provider, or a delivery company has found a problem, and they need the code you just received to fix it. No legitimate company does this. Real support never asks for your code, because asking for it would defeat the entire point of the code. The second version is the fake "verify your account" message that arrives with a link: the link goes to a copy of the real login page, you type your password and then the code, and the attacker types both into the real page in real time. The third is the simplest: a message claiming you won something, or that your package is held, with a code to "confirm" — and the code it asks for is the one your bank just sent you for a transaction you never made.
The defence is one sentence, and it covers all three: a code you receive is for your eyes and one entry box only — the one on the service's own page, in the session you started yourself. The moment anyone asks you to read it aloud, paste it into a chat, or type it on a page you reached from a link in a message, stop. The request is the scam.
Frequently asked questions
What is OTP in banking? It is a one-time code your bank sends — by SMS, email, or its app — to authorise one specific action, like logging in, adding a payee, or confirming a payment. The code is valid for minutes and for that action only. Your bank will never call or message you asking for the code back.
What's an OTP code? A short numeric code, usually six digits, generated for a single login or transaction and useless afterwards. It is also called a verification code, a one-time passcode, or a 2FA code. The code is the service asking, in real time, "prove it is really you, right now, on a device only you hold."
What is TOTP? A time-based one-time password. It is the code your authenticator app generates every 30 seconds from a shared secret and the current time, defined in RFC 6238. Nothing is sent to you; your phone and the server compute the same code independently. TOTP stands for time-based one-time password.
What does TOTP stand for? Time-based one-time password. Its older sibling, HOTP, stands for HMAC-based one-time password and uses a counter instead of the clock — which is why its codes can desynchronise if the button is pressed too many times without logging in.
What is a HOTP token? A hardware token — a key fob or a card — that generates one-time passwords from a shared secret and an internal counter, under RFC 4226. Each button press advances the counter and produces a new code. They work without a phone or a clock, but if the counter drifts too far ahead of the server's, the codes stop matching until the token is resynchronised.
Can an OTP arrive by email? Yes — email OTP is one of the four standard delivery routes, alongside SMS, authenticator apps, and voice calls. The code arrives as an ordinary email, usually valid for five to ten minutes. It works in any inbox, including a temporary one, but only for services that accept the address you give them: many banks and large platforms refuse disposable addresses, sometimes silently, and the code simply never arrives.
The bottom line
An OTP is a small idea with a large job: make every login a fresh secret, so stealing yesterday's secret buys nothing. There are three kinds you will actually meet — the app code computed from a secret and a clock, the counter code on a hardware token, and the code sent to your phone or inbox — and the right choice depends on what the code protects. Use an authenticator app for anything that holds money or your identity. Use email codes for low-stakes signups, and a temporary inbox when the signup is disposable. Use SMS only when nothing better is offered. And never, for any reason, read a code to someone who asks for it.
The code dies in seconds or minutes on purpose. That short life is the whole security model — and once you see it, you will never be annoyed by an expired code again. You will be reassured by it.
Need a disposable temporary email?
Protect your real inbox from spam and promotional clutter instantly and free.
Received a suspicious email, text, or charge alert?
Verify whether the sender domain is disposable, spoofed, or unverified before clicking links.