twoodo
/

Home/Tools/Random & decision

Random Number Generator

Press space to generate again.

Space bar generates again.

With or without repeats

The distinction matters more than it sounds.

  • With repeats (the default) is drawing with replacement — each number is picked independently, so the same one can come up twice. This is what dice and coins do, and what most people mean by random.
  • No repeats is drawing without replacement, like a lottery or pulling names from a hat. Each pick reduces what is left.

Picking six numbers from 1–49 with repeats is not a lottery draw. A real draw removes each ball, which changes the odds for every subsequent one.

The birthday surprise

Ask for ten numbers between 1 and 100 with repeats allowed and you will see a duplicate far more often than feels right. There is roughly a 37 % chance of at least one repeat.

It is the same arithmetic as the birthday problem: with 23 people in a room, there is better than an even chance two share a birthday. The reason is that you are not comparing each number against one other, but every number against every other — 45 pairs in a group of ten.

Randomness clumps, and people do not expect it

Generate fifty numbers from 1 to 10 and you will see runs, gaps and numbers appearing three times in a row. That is what random looks like. Asked to write down a "random" sequence by hand, people spread things out far too evenly and almost never repeat.

This is exploitable, and it is exactly why human-chosen PINs and passwords are weak.

There is no "due" number

If 7 has not come up in fifty draws, its chance next time is unchanged. Numbers have no memory. The belief that a result is overdue is the gambler's fallacy, and it is the single most profitable misconception in the history of casinos.

Common uses

  • Picking a winner from numbered entries.
  • Choosing lottery numbers, with repeats switched off.
  • Sampling — selecting rows or records to check.
  • Deciding something when you genuinely do not mind.

Questions people ask

What is the difference between allowing repeats or not?

With repeats, each number is drawn independently and can come up twice. Without, it is like a lottery — each pick removes an option.

Why do I keep seeing duplicates?

Because they are likelier than intuition suggests. Ten numbers from 1–100 have about a 37 % chance of a repeat — the same arithmetic as the birthday problem.

Is a number ever 'due'?

No. Numbers have no memory, and a result that has not appeared is no likelier next time. That belief is the gambler's fallacy.

Is this random enough for a prize draw?

Yes. It uses the browser's cryptographic random source, not the predictable Math.random that most tools use.

Why does the sequence look clumpy?

Because genuine randomness clumps. People asked to invent a random sequence spread it out far too evenly.

Where the randomness comes from

Every result on these pages uses crypto.getRandomValues, your browser's cryptographically secure random generator, seeded by the operating system from genuinely unpredictable physical sources.

That is deliberately not Math.random(), which most tools use. Math.random is a deterministic algorithm producing numbers that look random; given enough output, its future values can be predicted. For a dice game that does not matter. For a prize draw, a password or anything anyone might want to game, it does.

The numbers are also produced by rejection sampling rather than by taking a remainder. Taking a random 32-bit number modulo 6 slightly favours the lower faces, because 232 does not divide evenly by 6. The bias is small and it is real, and discarding the leftover tail removes it completely.

Nothing leaves the page

Results are generated in your browser and are not transmitted or stored. Reload the page and they are gone — which matters most on the password generator.