Flip a fair coin 100 times and there is about a 6 percent chance you get 60-or-more of one side, a result most people would swear proves the coin is rigged. Human intuition is the worst randomness detector ever fielded, which is why fair decisions need real randomizers and why “this looks suspicious” needs arithmetic before accusation. This guide covers what true randomness looks like, how computers fake it and when the fake matters, with our free coin flip and dice roller as the working randomizers.
In this guide
What randomness actually looks like
Real randomness is streakier than intuition expects. In 100 fair flips, the longest run of identical results averages about seven in a row, and a streak of six or more appears in roughly four out of five experiments; ask people to write down “random” flips by hand and they avoid streaks beyond three, which is how statistics teachers catch fabricated homework. The same miscalibration runs the other way: perfectly balanced results are suspicious too, since exactly 50-50 in 100 flips is itself uncommon. Genuine randomness is lumpy, locally patterned and globally fair, and every section below is a consequence of that one description.
The gambler’s fallacy, stated precisely
After five heads in a row, the chance of a sixth head is exactly one half, because the coin stores nothing. The fallacy is expecting tails to be “due”, and its mirror twin, the hot-hand read of “heads is on a roll”, errs identically in the other direction. What confuses people is that the long run really does even out, so surely the coin must steer back? The resolution is that the law of large numbers works by dilution, not correction: a surplus of five heads does not get cancelled by future tails, it gets swamped by thousands of future flips that split evenly, shrinking the surplus as a percentage while never erasing it as a count. The coin owes nothing, and the percentages converge anyway.
Pseudo-randomness: the respectable fake
Computers are deterministic, so their everyday “randomness” is pseudo-randomness: an algorithm stretching a starting seed into a long sequence that passes statistical tests despite being fully reproducible from the seed. For games, simulations, shuffles and randomized decisions, this is not a compromise but the right tool, and reproducibility is often a feature, since re-running a simulation from the same seed is how results get debugged. Our coin flip and dice roller run on exactly this machinery in your browser, which for deciding who pays for dinner is overkill in the right direction.
When the fake is not good enough
The line is adversaries: the moment someone profits from predicting your numbers, ordinary pseudo-randomness fails, because a sequence reconstructible from its seed is a sequence an attacker can reconstruct. Passwords, session tokens, keys and lottery draws need cryptographically secure randomness, where the generator is seeded from physical unpredictability the operating system harvests (timing jitter, hardware noise) and designed so past output reveals nothing about future output. In the browser this is a different API, and it is what the random bytes generator draws from: bytes fit for secrets, not just for games. The same well supplies the random bits inside UUIDs, the coordination-free identifiers covered in the UUID guide. The practical rule is one sentence: if a wrong guess merely loses a game use either, if a right guess steals something use the secure source.
Testing fairness like an adult
Fairness testing is comparing deviation to expectation, never eyeballing. For a coin, the yardstick at 100 flips: results between roughly 40 and 60 are unremarkable, since the 6-percent tail from the introduction says 60+ happens to fair coins routinely; suspicion earns its keep past that, and certainty needs more flips, because the resolving power grows with sample size. For dice the same logic spreads across six faces: 120 rolls put the expectation at 20 per face, and counts like 26 or 14 are noise, not loaded dice. Two honest habits complete the kit: decide the threshold before collecting the data (post-hoc suspicion always finds a pattern), and double the sample before doubling the accusation. The arithmetic for either is two pastes into the statistics calculator, whose three centers are read properly in the mean, median and mode guide, with the wider toolbox in the calculators hub.
Frequently asked questions
Is a physical coin flip actually fair?
Very nearly, with footnotes: research on real flips finds a tiny bias toward the side facing up at launch, on the order of half a percent, and spinning (rather than flipping) some coins is measurably unfair. For any decision short of a research study, the physical flip and the digital one are both fine.
Can I get true randomness from a website?
The secure browser API delivers randomness seeded from the operating system’s physical entropy, which is true enough for cryptography and far beyond any human use. Dedicated hardware generators exist for the truly paranoid layer below that, measuring quantum or thermal noise directly.
Why did my shuffled playlist play the same artist twice in a row?
Because fair shuffles produce clusters, exactly like the streaks in the first section. Several music apps deliberately de-randomize their shuffle to feel more random, which is the neatest possible summary of human randomness intuition: the genuine article fails the vibe check.
How many dice rolls prove a die is loaded?
There is no magic number, only growing confidence: deviations that persist as the sample grows are signal, deviations that shrink are noise. As a rough scale, a bias big enough to matter in a board game shows reliably within a few hundred rolls, and a casino-grade subtle bias needs thousands.