Random Number Generator
Generate random numbers between any two whole numbers: one, or a list of up to 10,000, with or without repeats, sorted or not, drawn by a secure generator.
Random Number Generator: A Quick Guide
Pick one random number or a whole list between any two whole numbers, with or without repeats, sorted or not. The numbers come from your browser's cryptographic random generator, and every number in the range is exactly as likely as any other.
How to use the generator
- Set the range with From and To. Both numbers can come up, and they can be negative or given in either order.
- Choose how many numbers you want, from 1 to 10,000.
- Turn on No repeats if each number may come up only once, as when drawing raffle winners or lottery numbers.
- Pick a sort order if you want the list from smallest to largest, or the other way round.
- Press Generate, or Enter in any field. Each press gives a new draw. Copy puts the numbers on your clipboard, separated by commas.
Examples
| To do this | From | To | How many | No repeats |
|---|---|---|---|---|
| Roll a die | 1 | 6 | 1 | off |
| Roll two dice | 1 | 6 | 2 | off |
| Flip a coin (1 heads, 2 tails) | 1 | 2 | 1 | off |
| Pick 6 lottery numbers out of 49 | 1 | 49 | 6 | on, sorted |
| Draw 3 raffle winners from tickets 1 to 500 | 1 | 500 | 3 | on |
| Shuffle the numbers 1 to 10 | 1 | 10 | 10 | on |
How random are the numbers?
They come from crypto.getRandomValues, the generator browsers use for encryption keys, not from the predictable Math.random. Turning its random bits into a number in your range is done with rejection sampling: a draw that would fall in the uneven leftover part of the bits is thrown away and drawn again. A simple remainder would make the lower numbers of some ranges slightly more likely; this way each of the To - From + 1 numbers has exactly the same chance.
With No repeats, the numbers are drawn the way a raffle drum works: once a number is out, it can't come up again. Taking every number of the range gives a random order of the whole range, a shuffle.
Frequently asked questions
Is this random number generator truly random?
It uses your device's cryptographic generator, which is seeded from unpredictable events in the hardware and the operating system. For games, draws, decisions and sampling it is as random as it gets; nobody, this site included, can predict or repeat a draw.
How do I get a random number between 1 and 100?
Set From to 1 and To to 100, the values the page starts with, and press Generate. Both 1 and 100 can come up.
Can I generate random numbers without repeats?
Yes: turn on No repeats. You can then ask for at most as many numbers as there are in the range, To - From + 1.
Are the numbers saved anywhere?
No. They are made in your browser and never sent to a server, so nobody else sees them.