Random Number Generator

Generate random numbers in any range online for free. Unique (no duplicates) and sort options, up to 1,000 at once. Cryptographically strong and private.

Random Number Generator

User Guide

1

Set the range

Enter a minimum and a maximum. Both ends are included, so 1 to 6 can return 1 and can return 6 — which is what you want for a dice roll, and a detail plenty of generators get wrong.

2

Say how many you need

Anything from 1 to 1000. One number settles an argument; a few hundred gives you a dataset to work with.

3

Decide whether repeats are allowed

No duplicates makes every number unique, which is what a raffle or a draw needs — the same ticket cannot win twice. Leave it off to model independent events such as dice or coin flips, where a repeat is a real outcome and removing it would distort the result.

4

Sort if it helps

Sort ascending orders the output low to high. Useful for reading a long list and checking coverage; leave it off when the order of the draw matters, as in a prize sequence where first out is first place.

5

Generate and copy

Press Generate, then Copy to take the whole list to your clipboard in one go, ready for a spreadsheet or a message.

About the Random Number Generator

People are extremely bad at being random. Asked for a number between one and ten, far too many choose seven; asked for a list, they unconsciously avoid repeats and adjacent values. Randomness that withstands scrutiny has to come from a machine.

Where the numbers come from

The generator uses the browser’s built-in Math.random(), a pseudo-random number generator. “Pseudo” means the sequence is produced by a deterministic algorithm from an internal seed — it is not random in a physical sense, but it passes the statistical tests that matter for draws, sampling and games.

The raw output is a fraction between 0 and 1, which is then scaled to your range and rounded. Doing that scaling carelessly introduces bias, where some values in the range become slightly more likely than others. It is a subtle, well-known trap, and it matters exactly when fairness is the point of the exercise.

Unique versus repeating draws, and why the choice is not cosmetic

This is sampling with or without replacement, and choosing wrongly quietly invalidates the result. A raffle must be without replacement — the same ticket winning twice is a broken draw. A simulation of dice must be with replacement, because two sixes in a row is a real outcome and removing it makes your model wrong in a way that is very hard to notice later.

Unique draws are produced by shuffling and taking from the top rather than by drawing and retrying on collisions. The shuffle is a Fisher–Yates shuffle, which guarantees every ordering is equally likely in a single pass. Draw-and-retry gets slower and slower as the pool empties; shuffling does not.

What this is not suitable for

This is not cryptographic randomness. Do not use it for passwords, tokens, keys or anything protecting money or secrets — those need crypto.getRandomValues(), which draws on the operating system’s entropy pool. The Strong Password Generator on this site is built on that.

Where it runs

In your browser, with nothing transmitted. For a public draw that is a genuine advantage: you can generate the result live on a shared screen with no server anyone could claim was consulted first.

Frequently Asked Questions

Frequently Asked Questions

Are the minimum and maximum included?

Yes, both ends are possible results. A range of 1 to 100 can return 1 and can return 100.

When should I use No duplicates?

Whenever the same result cannot legitimately occur twice — raffles, drawing names, picking a unique sample. Leave it off for dice, coin flips and anything modelling independent events.

What if I ask for more unique numbers than the range holds?

It cannot be done — you cannot draw 50 unique numbers from a range of 10. Widen the range or reduce the count.

Is this random enough for a prize draw?

Yes. Browser randomness is well beyond what any draw requires. Generating it live on a shared screen also makes the process visibly fair, which for a public draw matters as much as the mathematics.

Can I use it to generate passwords?

No. This is not cryptographic randomness. Use the Strong Password Generator, which is designed for that and produces output suitable for protecting accounts.

Does sorting change the randomness?

No. The numbers are drawn first and then ordered for display. Sorting only changes how you read them, never which ones came out.