BroadNet
Free developer tool · runs in your browser

OTP security calculator.

Configure a one-time-passcode scheme — length, character set, expiry and attempt limit — and see the exact combination space, entropy in bits, the odds of a successful guess, brute-force resistance, and a strength rating with concrete hardening advice. The math is exact and runs entirely in your browser.

Configure your OTP scheme
6

Number of digits or characters in the code (4–12).

Alphabet size: 10

How long the code stays valid before it rotates or expires.

Verification attempts allowed before the code is locked or invalidated.

attempts / second

An assumed automated guessing rate. Used only to estimate brute-force time — leave blank if unknown.

Try an example
Strength analysis
StrongStrength rating
Total combinations
1,000,000
≈ 1.000e+6 · alphabet ^ length
Entropy
19.9 bits
length × log₂(alphabet)
Guess chance per attempt
1 in 1,000,000
Chance within the attempt limit(5×)
1 in 200,000
5.00e-4%
Time to try every code
Time to try every code
13.9 hours
Average time to a hit
6.9 hours
Attempts possible per validity window: 6.000e+3

The attempt limit caps a real attacker at 5 — the lockout, not the rate, is the binding constraint.

At this rate the code expires long before the space can be exhausted — online brute-force is effectively impossible. Security rests on the attempt limit and short expiry, not on the code length alone.
Rating thresholds (guess chance within the attempt limit)
  • Very strong — 1 in 1,000,000 or better (meets the NIST-referenced target)
  • Strong — better than 1 in 100,000
  • Fair — better than 1 in 10,000
  • Weak — worse than 1 in 10,000

This weak / fair / strong / very-strong rating is the tool's own heuristic — it is not an external standard. It scores the chance of a successful guess within your attempt limit against the thresholds below. The combination space, entropy and probabilities are exact math.

Recommendations
  • Numeric OTPs are the standard for SMS and are easy for users, but their small space means security depends on rate-limiting and short expiry — not on the code itself. Keep both tight.
  • Enforce a hard server-side lockout after a few failed attempts. Without it, the 'chance within the attempt limit' above is meaningless and the full space becomes brute-forceable.
  • Shorten the validity window. A code valid for several minutes gives an attacker far more guessing time than one valid for 30–60 seconds.
  • For high-value actions such as payments or account recovery, add device binding, step-up auth, or a second factor. An OTP alone is a single shared secret over one channel.

The short answer

How strong is an OTP, really?

An OTP's raw strength is just its combination space: the alphabet size raised to the code length. A 6-digit numeric code has one million combinations and about 19.9 bits of entropy — trivially small by cryptographic standards. What actually keeps it safe is not the code but the controls around it: a strict attempt limit before lockout and a short expiry window. With a 5-attempt lockout, the chance of guessing a 6-digit code is 5 in 1,000,000 — roughly 1 in 200,000. Remove the lockout and the same code falls in seconds. This tool computes both the raw math and the practical, lockout-bounded odds so you can see exactly where your scheme's security comes from.

The math behind OTP strength

Total combinations = alphabet ^ length, computed exactly with big-integer arithmetic so even large spaces are shown to the digit. Entropy in bits = length × log₂(alphabet); every extra character adds log₂(alphabet) bits. The chance of a single random guess is 1 ÷ combinations. Across an attempt limit of N, the chance of at least one hit is approximately N ÷ combinations, which we express as a clear '1 in X' and a percentage. If you supply an assumed attacker rate, the time to try every code is combinations ÷ rate, and the average time to a hit is half that — but a real attacker is stopped first by whichever comes sooner: the attempt lockout or the code's expiry.

What NIST 800-63B says

NIST Special Publication 800-63B treats a short OTP as a low-entropy secret whose safety depends on throttling, not length. It directs verifiers to rate-limit failed authentication attempts and references keeping the probability of a successful online guess over the life of the authenticator below roughly 1 in 1,000,000. In other words, a 6-digit code is acceptable only because the verifier limits attempts and expires the code quickly — the length alone is not what makes it secure. The 'very strong' tier in this tool is aligned with that 1-in-1,000,000 target; the tier labels themselves are our own heuristic, not a NIST classification.

Common OTP schemes compared

Exact figures for typical configurations, assuming a 5-attempt lockout. Longer or larger-alphabet codes buy headroom, but the attempt limit does most of the work.

Common OTP schemes compared
SchemeCombinationsEntropyChance in 5 attempts
4-digit numeric10,00013.3 bits1 in 2,000
6-digit numeric1,000,00019.9 bits1 in 200,000
8-digit numeric100,000,00026.6 bits1 in 20,000,000
6-char alphanumeric2,176,782,33631.0 bits1 in 435,356,467
8-char case-sensitive218,340,105,584,89647.6 bits1 in 43,668,021,116,979

Frequently asked questions

Is a 6-digit OTP secure?

On its own, no — a 6-digit numeric code has only one million combinations and about 19.9 bits of entropy. It becomes secure in practice through a strict attempt limit and a short expiry: with a 5-attempt lockout the odds of guessing it are about 1 in 200,000. Remove the lockout and it is brute-forceable in seconds. Security comes from the controls, not the digits.

How is OTP entropy calculated?

Entropy in bits equals the code length multiplied by the base-2 logarithm of the alphabet size. A 6-digit numeric code is 6 × log₂(10) ≈ 19.9 bits; an 8-character case-sensitive alphanumeric code is 8 × log₂(62) ≈ 47.6 bits. Each added character contributes log₂(alphabet) more bits.

Why does the attempt limit matter more than length?

Because online OTPs are guessed one request at a time, not computed offline. If the verifier locks the account after 5 wrong tries, an attacker gets at most 5 chances against the whole space regardless of how fast they can send requests. That single control turns a one-million-combination code into roughly 1-in-200,000 odds. Without it, the same code offers almost no protection.

Does a longer or alphanumeric code help?

It raises entropy and shrinks the guess odds, which helps for high-value flows or when rate-limiting is weak. But it also hurts usability — longer and mixed-case codes are harder to type and more error-prone over SMS or voice. For most flows, a 6-digit numeric code with a tight lockout and short expiry is the pragmatic balance; reserve longer codes for high-risk actions.

What does the strength rating mean?

It is this tool's own heuristic, not an external standard. It scores the chance of a successful guess within your configured attempt limit: 1 in 1,000,000 or better is 'very strong' (aligned with the NIST-referenced target), better than 1 in 100,000 is 'strong', better than 1 in 10,000 is 'fair', and anything weaker is 'weak'. The underlying combination space, entropy and probabilities are exact math.

Does this tool send my configuration anywhere?

No. Every calculation runs in your browser using big-integer arithmetic for the combination space. Nothing is transmitted, logged or stored. You can disconnect from the network and it still works.

Building OTP into your product?

BroadNet delivers one-time passcodes over SMS and voice with the throttling, expiry and delivery controls that make short codes safe. Talk to our team about your verification flow.