Random Number and Name Picker

Pick random numbers or names with a cryptographic generator, with optional no-repeat, for draws, teams and raffles.

Enter the values to see the result here.

Formula

To pick a uniform integer in [0,n)[0, n) from a 32-bit random value x∈[0,232)x \in [0, 2^{32}), reject values in the uneven tail and keep the rest:

limit=232−(232 mod n),result=x mod n  if x<limit\text{limit} = 2^{32} - (2^{32} \bmod n),\qquad \text{result} = x \bmod n \ \text{ if } x < \text{limit}

Numbers between mm and MM use m+resultm + \text{result} with n=M−m+1n = M - m + 1. For picks without repeats from a list, a Fisher-Yates shuffle swaps each position ii (from the end) with a random earlier position j∈[0,i]j \in [0, i] and takes the first kk items; the chance of any particular ordered selection is 1/(N!/(N−k)!)1 / (N!/(N-k)!).

Worked example

A class of 6 needs a presenter and two note-takers. Paste the six names, set “How many?” to 3, keep “No repeats” ticked.

  • The first pick is uniform over 6 names, probability 1/61/6 each.
  • The second is uniform over the remaining 5, probability 1/51/5.
  • The third over the remaining 4.

Any particular ordered trio has chance 1/(6×5×4)=1/1201/(6 \times 5 \times 4) = 1/120. For a lottery-style draw of 6 distinct numbers from 1 to 49, the odds of a specific set are 1/13,983,8161/13{,}983{,}816.

Common mistakes

  • Turning off “no repeats” and expecting a draw with three distinct winners.
  • Re-drawing until a favourite comes up, which defeats the randomness.
  • Treating a short streak (three heads in a row) as evidence the generator is broken.
  • Pasting names with trailing spaces or blank lines. They are trimmed, but duplicates are not removed.

Frequently asked questions

Is this truly random?

It uses the browser's cryptographically secure generator (crypto.getRandomValues), the same source used for encryption keys. Math.random is never used, and results are not seeded or repeatable.

What does "no repeats" do?

Each value can be picked once, like drawing numbers from a hat. Turn it off to allow the same value to appear more than once, like rolling a die repeatedly.

Why not simply use the remainder of a random number?

Taking a random 32-bit number modulo the range slightly favours small values unless the range divides 2³² exactly. This tool rejects the uneven tail of the range so every value is equally likely.

Can I use it for a giveaway?

For informal draws, yes. For prizes with legal rules, follow your jurisdiction's requirements and keep an independent record of the entries, since a browser tool leaves no audit trail.

Related calculators