How Random Generators Work (and How to Tell if One Is Fair)
Updated 22 November 2026 · By Rafi Noor
Every time you press Generate on RandomPicky, your browser picks one option from a list. It sounds simple, but picking fairly is harder than it looks. This guide explains, without heavy maths, how computers produce random numbers, the mistakes that make a picker unfair, and how to judge any random tool you use.
Computers can't flip a coin
A computer is built to follow instructions exactly, which makes genuine unpredictability tricky. Programs solve this in two ways:
- Pseudo-random number generators (PRNGs) use a formula that turns one number (the "seed") into a long sequence that looks random. They're fast and fine for animations or simple games, but anyone who knows the formula and the seed can predict every result. JavaScript's classic
Math.random()works this way. - Cryptographically secure generators (CSPRNGs) are designed so that results can't be predicted, even by someone who has seen earlier outputs. Operating systems seed them with hard-to-predict "entropy", such as timing noise from hardware. Browsers expose one through
crypto.getRandomValues(), the same kind of randomness used to create encryption keys.
Every RandomPicky tool uses crypto.getRandomValues(). For picking a team or a meal that's more than you need, but it means there's no hidden pattern, and nothing about the result depends on a server you can't see.
The hidden bias: picking from a list
Secure random numbers aren't enough on their own. The generator produces a large random number, for example between 0 and 4,294,967,295, and the tool has to turn it into a choice from, say, 30 NBA teams. The obvious way is to divide by 30 and take the remainder (the "modulo"). But 4,294,967,296 isn't exactly divisible by 30, so a few teams get one extra chance. The difference is tiny, but it's real, and with small number ranges it can be large.
The fix is called rejection sampling: if the random number falls into the leftover range that would cause bias, throw it away and draw again. RandomPicky does exactly this, so every option has precisely the same probability.
Shuffling fairly: the Fisher–Yates method
When you ask for several results with no repeats, the tool needs a fair shuffle. A surprisingly common mistake is to "sort the list randomly", which produces some orders more often than others. The correct method, known as the Fisher–Yates shuffle, walks through the list from the end, swapping each item with a randomly chosen item at or before it. Every possible order is then equally likely. With 30 teams that's more orders than there are grains of sand on Earth, and each one has the same chance.
Why fair results look unfair
People expect randomness to look evenly spread, but true randomness is lumpy. Flip a fair coin 20 times and there's close to a 50% chance of seeing at least four heads in a row somewhere. Believing that a result is "due" after it hasn't appeared for a while is called the gambler's fallacy: a fair picker has no memory, so past results never change the next one.
That's why a fair decision maker can pick the same option twice in a row. With three options it happens one time in three. If you need every option used once, use a no-repeat or shuffle mode instead of spinning repeatedly.
How to judge any random tool
- Where does the randomness come from? Look for a secure source such as
crypto.getRandomValues()or a reputable service, not an unexplained server. - Can you see the full list? A fair tool tells you exactly what it chooses from. On RandomPicky every generator lists its full set of options.
- Does it store or change your inputs? Tools that run in your browser can't quietly favour certain results for advertisers or sponsors.
- Is there a no-repeat option? For draws, rosters and running orders, a shuffle is fairer than repeated spins.
Sources
- MDN Web Docs: Crypto.getRandomValues()
- Donald E. Knuth, The Art of Computer Programming, Vol. 2: Seminumerical Algorithms (Addison-Wesley), section 3.4.2, on random shuffling (the Fisher–Yates method)
Frequently asked questions
Is Math.random() good enough for a random picker?
For casual use it is usually fine, but it is not designed to be unpredictable. A cryptographically secure source such as crypto.getRandomValues() is the better choice when fairness matters.
Can a random generator be truly random?
Computer generators seeded with physical entropy are unpredictable for every practical purpose. Physically "true" randomness from hardware noise exists, but it is not needed for fair everyday picks.
Why did the same result come up twice?
Each pick is independent. With n options there is a 1-in-n chance of repeating the previous result, so repeats are expected from a fair tool.