Random Number Picker

Pick one or many random numbers in any range, with or without repeats.

How this works

Set a minimum and maximum (negative numbers allowed), choose how many you want, and decide whether duplicates are OK. The widget then pulls cryptographically uniform integers from the inclusive range. With repeats off, it uses a partial Fisher–Yates shuffle so even drawing 100 numbers from a 1–1,000,000 range stays fast and gives genuinely uniform results — no rejection-loop blow-up. The output is sorted ascending so you can scan the picks at a glance and spot the smallest/largest, which matters more often than seeing the order they were drawn in (raffle winners are usually announced lowest-to-highest by ticket number, lottery numbers are read in ascending order, etc.).

The formula

With repeats: for each of N, pick uniform int in [min, max] using rejection sampling on a 32-bit byte. Without repeats: build pool = [min..max], then for i = 1..N pick j ∈ [0, pool.length-1], take pool[j], swap with pool[end], pop.

N is the number of picks, min/max are inclusive bounds. The "rejection sampling" step throws away byte values that would land in the small "remainder" zone where modulo would over-represent the low end of the range — same uniformity-preserving trick the dice roller uses. The Fisher–Yates draw is the standard "shuffle a deck and take the top N cards" algorithm, simplified to only draw N cards instead of shuffling the whole pool. It runs in O(N) time and uses O(max-min) memory.

Example calculation

  • Lottery 6/49: min=1, max=49, count=6, no repeats → e.g. [4, 11, 19, 27, 33, 42].
  • Coin-side simulation: min=0, max=1, count=20 with repeats → 20 zeros/ones for stats demos.
  • Pick a temperature anomaly: min=-30, max=45, count=1 → e.g. -7.

Frequently asked questions

Can I pick decimals (e.g. 0.0–1.0), not just integers?

Not directly — the widget returns integers. For 0.0–1.0 with three decimal places, ask for integers in 0–1000 and divide by 1000 in your head (or in a spreadsheet). For arbitrary precision a future upgrade could expose a "decimal places" toggle, but the integer version covers >95% of the use cases people actually have (raffles, dice-equivalent draws, picking a value from a discrete list).

Why are the results sorted?

Because for most use cases (raffle winners, lottery numbers, sampling) the order they were drawn in doesn't matter — readers care about which numbers came up, in a form that's quick to scan. Sorted ascending makes it instantly obvious what the smallest and largest picks are. If you do need draw order (e.g. for ranked picks), generate them one at a time using count = 1 and copy each result before regenerating.

What's the difference between "with repeats" and "without"?

"With repeats" means each pick is independent — the same number can appear twice (or more) in the same set. Mathematically, "with replacement" sampling. Used when you want a fresh independent draw each time (e.g. simulating coin flips, generating a stream of unrelated test values). "Without repeats" means each number can only appear once across the set, like drawing balls from a bag without putting them back. Used when there's a finite pool of slots (raffle tickets, lottery numbers, drawing teams from a roster).

Is there a maximum range or count?

The widget caps "how many" at 500 to keep the result list readable. The range itself can be up to roughly ±2 billion (32-bit integer limit), so for any normal use you won't hit it. With repeats off, the count must of course be ≤ (max − min + 1), since you can't draw 100 unique numbers from a range of only 50. The widget shows an inline error if you ask for the impossible.

Related calculators