"Just pick a random number" sounds simple, but building a picker that's actually mathematically fair — where every option truly has an identical chance of winning, no matter how many options there are — involves a couple of subtle steps that a lot of quick implementations skip.

The Hidden Bias in Naive Randomness

A common shortcut for picking a random option out of, say, 7 choices is to generate a large random number and take its remainder when divided by 7 (the modulo operation). The problem is that if the total range of possible random numbers doesn't divide evenly by 7, some remainders end up landing very slightly more often than others purely as an artifact of the leftover, unevenly distributed values at the top of the range. It's a small skew — often a fraction of a percent — but it means the picker isn't perfectly fair, which matters if you care about the math actually being correct rather than just looking random.

How Rejection Sampling Fixes It

The fix is called rejection sampling: instead of accepting every random number generated, the largest possible range is trimmed down to the biggest multiple of the option count that still fits, and any generated number that falls in the small leftover remainder is thrown away and re-rolled. Because only numbers within that evenly-divisible range are ever used for the final modulo calculation, every option ends up with an exactly equal, mathematically provable chance of being selected — no matter whether there are 2 options or 20.

Tip: Rejection sampling occasionally has to re-roll a number, but this happens invisibly and near-instantly — it doesn't meaningfully slow anything down, it just quietly removes the bias a naive modulo approach would otherwise introduce.

Why Cryptographic Randomness, Specifically

There are two broad categories of random number generation in a browser: Math.random(), a fast pseudorandom generator meant for things like animations and games, and the Web Crypto API's crypto.getRandomValues(), designed for security-sensitive uses like generating passwords or encryption keys. The cryptographic generator draws from a much higher-quality source of entropy and isn't predictable even in principle, which makes it the more rigorous (if technically unnecessary for casual use) choice for a picker that wants to claim genuine fairness rather than "good enough" randomness.

Why the Animation Doesn't Affect the Outcome

It's worth being explicit about this because it's genuinely not obvious from watching a wheel spin: the winning option is calculated the instant the spin is triggered, before any visual animation plays. The wheel's rotation, deceleration, and the pointer landing on a specific slice are purely a presentation layer built to visually reveal an already-determined result — similar to how a shuffled deck of cards is already in its final order the moment it's shuffled, even though dealing it out happens one card at a time afterward.

Spin It Yourself

Enter any list of options into the free Random Decision Wheel and spin it for a fair, animated pick — great for anything from choosing a restaurant to picking who goes first.

FAQ

Is the spin actually fair and random? Yes — the winning slice is chosen using your browser's cryptographically secure random number generator (the same kind used for passwords) with rejection sampling, which guarantees every option has an exactly equal chance of being picked, regardless of how many options there are.

What is "modulo bias" and why does it matter for random pickers? If you generate a large random number and reduce it to a smaller range using the modulo (remainder) operator, some remainders end up very slightly more likely than others whenever the range doesn't divide the total number of possible values evenly. It's a small effect, but it means a naive implementation isn't perfectly fair — which is exactly the bias that rejection sampling is designed to eliminate.

What does "rejection sampling" actually do? It discards and re-rolls any generated number that falls in the small leftover range that would otherwise cause modulo bias, only accepting numbers that divide evenly into the desired range. The result is a selection where every option has a mathematically exact, equal probability, at the cost of very occasionally generating a number twice.

Is the spinning animation just for show, or does it affect the result? The winning option is determined the instant you click "Spin" — the animation is purely a visual reveal of that already-decided result, not something that influences which option wins.

Need to make a fair random pick right now? Try the free Random Decision Wheel — no sign-up, nothing sent to a server.