Random number generator

Pick numbers from any range. One number for a single decision, or a batch when you are drawing numbered tickets and no number may repeat.

Generate numbers

Whole numbers only. Negative values are fine.

Press Generate and the numbers appear here.

When numbers beat names

Numbers scale in a way that name lists do not. A raffle with 4,000 paper tickets cannot be pasted into a wheel, and it does not need to be: the tickets are already numbered, so drawing “a number between 1 and 4000” is the whole job. The same applies to a spreadsheet of entrants where each row has an index, a queue where people took a numbered slip, and any prize draw where you promised to publish the winning number rather than the winner's name.

The trick that makes this work in practice is the no-repeats option. Turn it off — which is the default — and you can draw five distinct winners in one go without accidentally awarding two prizes to ticket 1,204. Turn repeats on when each draw should be genuinely independent, like simulating dice or picking a random page number to check.

About the no-repeats limit

You cannot draw ten unique numbers from a range that only holds eight, and the tool will tell you so rather than looping forever or silently giving you duplicates. If you see that message, either widen the range or allow repeats — there is no third option, because what you asked for is arithmetically impossible.

Behind the scenes we switch strategy based on how big the range is. For ordinary ranges we build the range and run a partial shuffle, which gives unique values with no wasted effort. For enormous ranges — where building the whole thing would be pointless — we draw and discard collisions. Both are uniform; the difference is only in speed and memory.

The bias nobody mentions

Almost every “random number between 1 and N” snippet on the internet takes a big random value and divides by N, keeping the remainder. It is one line, it looks obviously correct, and it is subtly wrong: unless the size of the raw random range divides evenly by N, the low numbers come up slightly more often than the high ones. With a small range and few draws you will never notice. With a big range or many draws, it is measurable.

We avoid it by discarding raw values that fall into the uneven tail and drawing again, so every number in your range has exactly the same chance. It costs a fraction of a millisecond and it is the difference between a generator that is uniform and one that is nearly uniform. The mechanism is explained without code in how random is random.

Are these numbers good enough for a prize draw?

For any ordinary promotion, yes. They come from your browser's cryptographic random generator, which draws on real system entropy rather than a formula, and the conversion into your range is unbiased. What they are not is independently audited — no browser tool can be. If a draw is large enough that a losing entrant might involve a lawyer, jurisdictions often expect a supervised or certified process, and you should check what applies to you before relying on any website.

Can I use this for passwords or security keys?

No. Not because the randomness is weak — the underlying source is the right one — but because generating a secret in a web page you did not audit, on a screen that might be shared or screenshotted, is a bad habit regardless of how good the generator is. Use your password manager.

Can it do decimals?

Not currently; it returns whole numbers only. For a decimal, pick a whole number from a larger range and divide it yourself — a number from 1 to 1000 divided by 100 gives you two decimal places between 0.01 and 10.00, with the same uniformity.

Nothing here is stored or uploaded. If a drawn number matters, copy it before you generate again — there is no history and no undo.

Related