Random Number Generator

Generate random numbers in any range, one or many at a time.

Generating random numbers

Set a minimum and maximum and this produces random integers in that range, inclusive of both endpoints. It uses the browser's crypto.getRandomValues(), a cryptographically secure random source, rather than the ordinary Math.random().

That distinction matters more than it might appear. Math.random() is a pseudo-random generator: fast, adequate for shuffling a carousel, and entirely predictable to anyone who observes a few outputs. For a prize draw, a giveaway, or anything where someone has an incentive to game the result, it is not appropriate.

Avoiding modulo bias

A subtle flaw in most naive implementations. Taking a random value modulo the range size does not distribute evenly unless the range divides the generator's output space exactly.

A generator producing 0-255, asked for 1-10:
256 / 10 = 25.6
Values 1-6 occur 26 times, values 7-10 occur 25 times
Result: the low numbers are about 4% more likely

The correct approach is rejection sampling — discard values that fall in the uneven tail and draw again. This tool does that, so every value in your range is equally likely. It is invisible in casual use and matters a great deal in a draw with a prize attached.

True randomness versus pseudo-randomness

TypeSourcePredictable?Use for
Pseudo-random (PRNG)An algorithm from a seedYes, given the seedSimulations, games, testing
Cryptographic (CSPRNG)Algorithm seeded with system entropyNo, in practiceDraws, tokens, keys, passwords
True random (TRNG)Physical noise — thermal, radioactive decayNoSeeding, high-security keys

The generator here is the middle category, drawing its entropy from the operating system's pool, which collects unpredictable timing information from hardware. For everything short of generating long-term cryptographic keys, that is more than sufficient.

Randomness does not look random

People are consistently poor judges of what random output should look like, and this causes needless suspicion of correctly working generators.

Using it for a fair draw

If you are running a giveaway, a few practical points make the result defensible: assign every entrant a number in a fixed, published order before drawing; state the range and the method in advance; draw once rather than repeatedly until you like the result; and if the stakes are high, record the draw or have a witness. For selecting several winners without repeats, draw one at a time and remove each winner from the range — or shuffle the full list, which is cleaner.

Generated locally

Numbers are produced in your browser. Nothing is transmitted and no result is logged, so no one — including us — can see or influence your draw. The flip side is that we cannot verify a draw for you either, which is why recording it yourself matters for anything contested.

Frequently asked questions

Are these numbers truly random?

They come from a cryptographically secure generator seeded by your operating system's entropy pool, which is unpredictable in practice. That is not the same as physical true randomness, but it is more than sufficient for draws, games and token generation.

What is modulo bias?

An uneven distribution caused by taking a random value modulo the range size when the range does not divide evenly into the generator's output space. Lower numbers come up slightly more often. This tool uses rejection sampling to avoid it.

Can I get the same number twice?

Yes, each draw is independent. Repeats are expected — drawing from 1 to 10 twenty times, a repeat is far more likely than not. If you need unique values, remove each result from the range before drawing again.

Is this fair enough for a prize draw?

The generator itself is. For a defensible draw, publish the entrant order and range beforehand, draw once, and record it. The mathematics is only part of what makes a draw credible.

Are my results sent anywhere?

No. Generation happens entirely in your browser and nothing is logged or transmitted. Nobody else can see or influence the outcome — and equally, we cannot verify it for you afterwards.

🔗 Related tools

🔑Password Generator🛡️Password StrengthAverage Calculator🎨Color Palette🎓GPA Calculator{ }JSON Formatter