Random Number Generator

Random numbers in any range — unique or repeating, one or a thousand, generated securely in your browser.

Runs in your browser Free, no sign-up Updated 2026-08-21

Your details

Please enter a valid value.

Please enter a valid value.

Please enter a valid value.

Order

Please enter a valid value.

Fill in the form to see your result.

How the randomness is generated

Uniform selection without biasspan = max − min + 1 limit = floor(2³² ÷ span) × span draw a 32-bit random integer x if x ≥ limit, discard it and draw again ← rejection sampling result = min + (x mod span)

This generator uses the browser's crypto.getRandomValues API, which draws from the operating system's cryptographically secure entropy pool — the same source used for encryption keys. It is a substantially stronger source than Math.random(), whose output is predictable to anyone who observes enough of it.

Mapping a random 32-bit integer into a smaller range naively introduces modulo bias: if the range does not divide evenly, some values become slightly more likely. This calculator uses rejection sampling — discarding and re-drawing values that fall in the uneven tail — so every number in your range is exactly equally likely.

With or without duplicates

  • Without duplicates models drawing from a hat: lottery numbers, raffle winners, random sampling without replacement. Each number can appear only once, so you cannot draw more numbers than the range contains.
  • With duplicates models rolling a die repeatedly: each draw is independent and previous results have no influence. Repeats are not a malfunction — in 20 draws from 1–100, at least one repeat happens more often than not.

That last point is the birthday problem in disguise. With just 23 people, the chance that two share a birthday is above 50%. Human intuition badly underestimates how often coincidences occur in random data, which is why genuinely random sequences often look "wrong".

Why random sequences look wrong

People are reliably bad at recognising randomness, and the mistake runs in a specific direction: genuine randomness is far clumpier than we expect.

  • Clusters are normal. In 100 coin flips, a run of six or seven of the same result is more likely than not. Its absence would be the suspicious thing.
  • The gambler’s fallacy. After five reds, black is not “due”. Independent draws have no memory whatsoever.
  • The birthday problem. In a room of 23 people, the chance two share a birthday is above 50%. At 70 people it is above 99.9%.
  • Humans cannot fake it. Asked to invent a random sequence, people alternate too often and avoid repeats — which is exactly how invented data gets detected in fraud investigations.

Music streaming services learned this the hard way: genuinely shuffled playlists generated complaints about repetition, so several now use a deliberately less random algorithm that spreads artists out. It feels more random precisely because it is not.

What it is and is not suitable for

Good for: raffles and giveaways, picking teams, random sampling for surveys and quality checks, choosing lottery numbers, generating test data, deciding who goes first, and settling arguments.

Not suitable for: generating passwords or cryptographic keys (use a dedicated password manager), or anything requiring auditable, verifiable randomness for regulated gambling — that needs a certified RNG with published seeds and independent verification.

Everything runs locally in your browser. No numbers are sent to a server, logged or stored, and reloading the page produces an entirely fresh draw.

Frequently asked questions

Is this random number generator truly random?

It uses your operating system's cryptographic entropy source through the browser's crypto API, which is the strongest randomness available to a web page. It is not a physical process like radioactive decay, but it is unpredictable for every practical purpose.

How do I generate lottery numbers?

Set the range to match your lottery — 1 to 49, 1 to 59, or whatever applies — choose how many numbers to draw, and keep duplicates switched off. Press Calculate for a fresh set.

Why do I sometimes get the same number twice?

Only when duplicates are allowed, which makes each draw independent. Repeats are far more common than intuition suggests — that is a property of genuine randomness, not a fault.

Can I use this to pick a raffle winner?

Yes. Number your entrants from 1 to N, set the range to match, and draw one number. For multiple winners, draw several with duplicates turned off.