The 1–5 range
One in five, twenty percent, five equal slices. The range fits a rating scale, a working week, a five-a-side squad and most shortlists that survived a first cut.
Small ranges repeat, and that catches people out. Two draws in a row match one time in five here. Over twenty draws you will almost certainly see a pair, and quite possibly a triple.
Ask for more than one number and the draw runs without repeats while the range allows it, so 1–5 with a count of five hands back all five in a shuffled order.
- 1 to 5, both included
- 5 whole numbers
- 20%, exactly 1 in 5
- 1 to 10 numbers per draw
- None up to 5 numbers, then unavoidable
- Every draw gets a link that replays it
What a 1–5 draw is for
- Drawing a score on a five-point scale for a blind test
- Picking a weekday for a recurring chore
- Choosing who starts among five players
- Selecting one of five prize envelopes
- Generating placeholder star ratings for a mock-up
How the randomness works
Every tap calls crypto.getRandomValues, the browser's cryptographic generator, and asks it for one unsigned 32-bit value. That lands somewhere between 0 and 4,294,967,295, and it then has to be folded down to the 5 numbers in this range.
Folding it down with a plain remainder is where most generators go wrong, an error known as modulo bias. 5 does not divide 4,294,967,296 evenly: 1 value is left over at the top, and wrapping it around would make the first 1 numbers in the range fractionally likelier than the rest. This tool throws away any raw value at or above the last exact multiple of 5 and draws a fresh one instead. That is rejection sampling. It fires about 1 in 4,294,967,296 draws, and it is the difference between 20% exactly and 20% approximately.
Ask for more than one number and the tool keeps drawing until it holds that many distinct values, then sorts them ascending. Nothing is seeded, nothing is sent anywhere, and each draw is independent of the one before it. The roll history under the tool lives in your browser's local storage, where the clear button empties it. The daily lucky numbers elsewhere on this site work the opposite way on purpose: they use a seeded generator so the same date always returns the same set. How random is random sets the two side by side.
Twenty percent each sounds tidy, and it is, but tidy odds still produce untidy sequences. Over a hundred draws from 1–5 the longest run of the same number is usually about three, and a run of four turns up more often than intuition allows. Streaks are not the generator drifting. A draw with no memory has no mechanism for avoiding them.
- crypto.getRandomValues, the browser's cryptographic generator
- One unsigned 32-bit value, sometimes more
- Rejection sampling onto 5 slots
- 1 of 4,294,967,296 raw values, redrawn
- No. These tools are never seeded
- Your browser. No server ever sees a draw
1–5 — frequently asked
Tap Generate; the range is already set. Each of the five numbers takes a fifth of the probability, with nothing weighted toward the middle.
Because one in five is not a small chance. Any two consecutive draws match 20 percent of the time, and three in a row happens once every 25 draws. It looks broken and it is the opposite: a generator that never repeated would be the biased one.
Set the count to 5. You get a full shuffle, one of 120 possible orders, each as likely as the rest.