Random Number Generator

A plain, fast number picker. Set a range, press generate, copy the result. Every value comes from your browser’s cryptographic random source, and nothing you enter here is sent anywhere — the page does all its work on your own device.

Pick a number

Result

—

Set a range and press Generate.

Roll dice

Flip a coin

One flip, heads or tails, with an even chance of each.

Where These Numbers Come From

The generator calls crypto.getRandomValues, the random source browsers expose for security work such as generating keys and tokens. It draws from the operating system’s entropy pool, which collects unpredictable physical signals: precise interrupt timings, device noise, and a hardware random instruction on most modern processors.

The alternative, Math.random, is a deterministic arithmetic formula. It produces numbers that look evenly spread and is perfectly adequate for shuffling a playlist, but it is seeded from a small amount of state, and an observer who sees enough consecutive outputs can work out that state and predict the rest. For picking a raffle winner or splitting people into teams, the cryptographic source is the better default, and it costs nothing to use.

Why a Remainder Is Not Good Enough

There is a subtle trap in turning a random 32-bit number into a number in a range like 1 to 100. The obvious approach takes the remainder: 1 + (draw % 100). That is very slightly unfair. There are 4,294,967,296 possible draws, and 100 does not divide into that evenly — it leaves a remainder of 96. The first 96 values in your range therefore have one more way of being hit than the remaining 4, so they come up marginally more often.

At a range of 100 the effect is far too small to notice. Widen the range and it grows: close to the full 32-bit span, a remainder can make some outcomes nearly twice as likely as others. This page avoids the problem with rejection sampling. It works out the largest multiple of the range that fits inside 232 and throws away any draw at or above that ceiling, taking another one instead. Discarded draws cost a fraction of a microsecond, and every number in your range ends up genuinely equally likely.

Things This Tool Is Useful For

For a lottery or anything with money attached, use a properly audited draw process. This is a convenience tool with an honest random source, not a certified one.

How This Differs From the Daily Puzzle

This page is deliberately unpredictable: press generate twice and you should get different answers. The daily puzzle is the exact opposite. Its number is derived from the calendar date, so it is fixed in advance and identical for everyone playing that day — that is what makes comparing scores meaningful.

The reasoning behind that split, and what “random” actually means in each case, is covered in the explainer on random number games and fairness. If you would rather just play, the daily number game is on the home page, and the rules take about two minutes to read.