Free Numbers Live Prices Top Services Pricing Reviews Feedback Terms & Policy API Docs Blog About
Log in Get Started
21 views 4 min read
Back to Blog
Guides

How Long Does an OTP Last? Expiry Times Explained

How Long Does an OTP Last? Expiry Times Explained

You received the code, switched to the app, typed it in, and the app says "code expired". It is annoying, but it is by design. This article explains how long different kinds of OTP stay valid and how to avoid the "expired" message.

What an OTP is

An OTP, or one-time password, is a short code that proves you control a phone number or an email address. It can be used once and it stops working after a short time. If you want the full picture of how the process works, read our guide on how OTP verification works.

Typical expiry times

There is no single rule, because each service chooses its own timeout. These ranges are common:

  • SMS codes for sign-up and login: usually 1 to 10 minutes.
  • Email verification codes: often 10 to 30 minutes, and sometimes up to a day for links.
  • Banking and payment codes: short, often 2 to 5 minutes, because the risk is higher.
  • Authenticator app codes (TOTP): 30 seconds, and the next code replaces the old one.
  • Password reset links: from 15 minutes up to 24 hours.

These numbers are typical ranges, not promises. The message in the app or in the SMS often states the exact time.

Why OTPs expire so quickly

A short life limits the damage if someone sees or intercepts the code. If a code stayed valid for days, an attacker would have a long window to guess or reuse it. A short timer, together with a limit on wrong attempts, makes guessing impractical.

Why a fresh code sometimes still says expired

  • You used an older code. When you press "Resend", the new code replaces the old one. Always use the latest message.
  • The SMS arrived late. A delay of a minute or two can eat most of the timer.
  • Your phone clock is wrong. This matters for authenticator apps. Turn on automatic time.
  • You requested too many codes. Some apps lock a number after several requests.

How to avoid the expired message

  1. Open the sign-up page and keep it ready before you request the code.
  2. Request the code once and do not leave the page.
  3. Copy the code the moment it arrives.
  4. If it expires, wait for the resend timer and use only the newest message.

OTP expiry when you use a virtual number

With a virtual number the timing has two parts: the app's code timer and the time the number stays reserved for you. On OtpGet a purchased number is reserved for a waiting period while it listens for the SMS, and the message appears in your order as soon as it arrives. Open the order page before you press "Send code" in the other app so you can copy the code immediately. For longer needs, a rental number keeps receiving messages for days.

How apps limit wrong attempts

The timer is only one layer. Most services also limit the number of wrong attempts, often three to five, and then lock the code or the number for a while. That is why guessing is not practical, and also why typing quickly and carefully matters. If you are locked out, wait until the lock period ends and start over with a new code instead of retrying the old one.

Security tips for codes you receive

  • Never share a code with anyone who contacts you. Real support teams do not ask for it.
  • Ignore codes that you did not request and consider changing your password, because it may mean someone is trying to log in.
  • Prefer an authenticator app over SMS for accounts that matter, since app codes do not travel over the phone network.

What developers should choose

If you build a sign-up flow, a code lifetime of about five minutes with a limited number of attempts is a common balance between security and convenience. Show a visible countdown, allow one resend after a short delay and invalidate the previous code when a new one is sent. When you test such a flow, a number from an OTP API lets you run the whole path automatically.

Frequently asked questions

Can I extend an OTP's life?

No. The timer is set by the service. Request a new code instead.

Is a longer OTP lifetime less secure?

Generally yes, because the code can be used for a longer time, which is why sensitive services use short timers.

Why does my code work for a few seconds only?

That is typical for authenticator apps. Their codes change every 30 seconds, so type the code quickly or wait for the next one.

Tags

#otp expiry time #how long does otp last #otp validity #one time password timeout #verification code expires
Contact us