Skip to content
Processing locally — files never leave your device

Random Generators

8 tools

Cryptographically random generators for numbers, dice rolls, coin flips, colors, gradients, and list pickers. Great for games, raffles, and breaking ties fairly.

Random generators, and why "random" is harder than it looks

A random generator does one job: produce an outcome that nobody — including the person running it — can predict in advance. That sounds trivial, but computers are deterministic machines that follow instructions exactly, so genuine unpredictability has to be manufactured carefully. The tools in this category cover the everyday cases: picking a number, rolling dice, flipping a coin, drawing a name, settling an argument, and conjuring a color out of thin air.

The jobs these tools actually do

People reach for randomness far more often than they realise. A teacher cold-calls a student without playing favourites. A streamer draws a giveaway winner on camera and wants it to look — and be — fair. A tabletop group needs a d20 when the physical dice have rolled under the couch. A designer wants an unbiased starting color instead of reaching for the same blue every time. A team decides who buys coffee. In each case the value is the same: a decision that feels neutral because no human thumb is on the scale.

Math.random versus a CSPRNG

Most casual randomness in JavaScript comes from Math.random(), which is fast but uses a pseudo-random algorithm seeded from internal state. It is fine for animations and good enough for a coin flip, but its output is statistically predictable if you know the seed, and it was never designed to resist someone trying to game it. For anything where fairness matters — raffles, giveaways, anything with a prize — our generators draw from crypto.getRandomValues(), a cryptographically secure source (a CSPRNG) that the browser feeds with real entropy from the operating system. The practical difference: the result cannot be reverse-engineered or reproduced, so a contest winner stands up to scrutiny.

The trap of modulo bias

There is a subtle bug in naive random-number code. If you take a raw 32-bit random value and squeeze it into a range with the modulo operator, some numbers come up slightly more often than others whenever the range does not divide evenly into the source. Over thousands of draws that tilt is measurable, and in a raffle it is the difference between fair and not. Our number, dice, and picker tools use rejection sampling — discarding the small leftover band of values — so every outcome in your range is equally likely, exactly as probability promises.

Popular random tools

Other categories