What Random Number Generator does, and when you need it
Random Number Generator picks whole numbers between two numbers you choose, one or up to 10,000 at a time, with every number in the range equally likely. Tick No repeats for numbers that are all different, and Sort them to see them in order. The numbers come from your device's secure random source, in your browser: your numbers are never sent anywhere, and there is no sign-up.
People use it when:
- A shop, a society or an office runs a lucky draw and needs a winning ticket number everyone can see picked fairly.
- A teacher calls on a roll number, or picks which questions go into a test.
- Someone checks a sample of invoices, forms or products instead of all of them.
- A family plays Tambola and needs the numbers 1 to 90 called in a random order.
To pick names rather than numbers, Random Name Picker takes a list; for dice and coins, Dice Roller and Coin Flip.
How it works
The page asks your browser for random numbers with crypto.getRandomValues, the source browsers use for encryption keys, rather than the everyday Math.random that games use. Turning those into a number in your range takes one more step that many tools skip: a plain remainder would make the lowest numbers of some ranges slightly likelier, so the page throws away the rare values that would cause that and draws again. Every number in the range then has exactly the same chance.
- No repeats: when you want more than a quarter of a range, the page shuffles the whole range and takes the first numbers, the way you would shuffle cards; when you want a few from a big range, it draws and simply skips any number already drawn. Either way, every set of numbers is equally likely.
- Sort them puts the numbers smallest first, after they are drawn, so it changes the order shown, not which numbers come up.
The small unfairness the page avoids
Here it is, made big enough to see. Suppose a random source gave numbers from 0 to 255, as one byte does, and a tool turned them into 1 to 100 with a plain remainder. 256 isn't a multiple of 100: the values cover 1 to 100 twice over, then 1 to 56 a third time. So each of 1 to 56 would come up 3 times in 256, and each of 57 to 100 only 2 times in 256:
| How the number is made | Each of 1 to 56 | Each of 57 to 100 |
|---|---|---|
| One byte and a plain remainder | 3 in 256 (1.17%) | 2 in 256 (0.78%) |
| This page | Exactly 1 in 100 | Exactly 1 in 100 |
The page draws from 4,294,967,296 values instead, a 32-bit number, which shrinks the tilt but doesn't end it: for 1 to 100, 96 of those values would still favour the lowest numbers. The page throws those 96 away and draws again, so the tilt is gone, not just small. That happens about once in 45 million draws, so the extra step is never noticed.
Real results from our tests
We ran the page's own number code (web/js/gen-core.js) in Node.js, which has the same crypto.getRandomValues as browsers, on a Windows 11 laptop on 31 October 2026, and counted what came out.
| What we drew | What came out | What it means |
|---|---|---|
| 1,000,000 numbers from 1 to 100 | Each number 9,823 to 10,293 times | Close to the 10,000 each that even chances give |
| The same, tested for evenness | A chi-square of 87.8 on 99 degrees of freedom | Well within what fair draws give; a bias would push it far higher |
| 11 numbers from -5 to 5, no repeats, sorted | -5 -4 -3 -2 -1 0 1 2 3 4 5 | Every number once: the whole range, shuffled then sorted |
| Speed | A million numbers in about 2.5 seconds | 10,000 numbers appear at once |
What the numbers mean: in a fair draw, counts wobble around the even share, as they did here, by about one per cent; a loaded generator shows the same numbers coming up again and again, and the chi-square test catches that. Ours passed it.
On a first visit the page downloads about 0.1 MB for the tool: the page, its styles, its scripts and the fonts, with Google's ad code not counted.
Step by step
- Type From and To: the smallest and largest numbers that may come up. Both are included.
- Type How many: 1 for a single winner, up to 10,000.
- Tick No repeats if every number must be different, and Sort them for smallest first.
- Press Generate. Up to 10 numbers show in large figures; more show as a list to copy or download as random-numbers.txt.
A lucky draw, done openly
The fairest draw is one everybody can watch. With tickets numbered 1 to 500:
- Announce the rules first: the range, 1 to 500, how many winners, and whether one ticket can win twice.
- Draw where people can see it: on a projector, a shared screen or a phone held up, with From, To and How many visible before you press Generate.
- Press once. For three prizes, set How many to 3 with No repeats, and say beforehand which number wins which prize: the first, the second, the third.
- Keep a record: a photo of the screen, or the downloaded list, with the date and time.
Pressing again until a liked number comes up is exactly what an open draw rules out, which is why the rules come first and the button is pressed once.
If a winner might not be in the room, draw reserves in the same press: for 3 prizes and 2 reserves, set How many to 5 with No repeats, and announce beforehand that the fourth and fifth numbers are the reserves, in that order.
Numbers without repeats
Without No repeats, each number is drawn on its own, so the same one can come up twice, just as a die can roll two sixes in a row. With it, every number is different, like drawing tickets out of a box without putting them back.
Repeats come up more often than people guess. Draw 10 numbers from 1 to 100 without the tick, and at least two of them match about 37 times in 100; draw 5 from 1 to 50, about 19 times in 100.
There have to be enough numbers to go round: 10 different numbers between 1 and 5 can't exist, and the page says how many different numbers the range holds. Asking for the whole range with No repeats gives every number once, in a random order, which is how to put a list in random order: number its items, then draw them all.
For IDs that must never repeat across systems or databases, a random number from a range isn't enough: a UUID is the usual choice, and UUID Generator makes them.
Tambola (Housie) calling
For Tambola, set From 1, To 90, How many 90, tick No repeats and leave Sort them unticked. Press Generate once: the list is the whole game's calling order, every number from 1 to 90 once, shuffled. Read them out from the top, one at a time, and tick them off. Keep the list on screen or download it, so anyone checking a claimed line or a full house can see which numbers have been called. For the next game, press Generate again: a fresh order, with no link to the last one.
Picking a sample to check
Checking every invoice, form or parcel takes too long; checking a random sample of them is the usual way to catch problems. Number the items, say 1 to 480 invoices in a month, then draw 25 with No repeats and Sort them, so they are easy to find in order. Because each item had the same chance, the sample isn't biased towards the ones that happen to be on top of the pile. Save the list with the check, so anyone reviewing it later can see which items were picked and that they were picked at random.
Picking from a list in a sheet
A list in Excel or Google Sheets needs no copying. With 500 entries in rows 2 to 501, draw one number from 2 to 501: it is the winning row. Fix the sheet before the draw, and say which sheet and which rows count: if the rows are sorted or filtered after the draw, the number points at someone else. For names typed or pasted straight in, Random Name Picker does the same without row numbers.
In the classroom
- Calling on students: From 1 To the class size, one number, the roll number to answer.
- Everyone once before anyone twice: draw the whole class with No repeats on Monday, keep the list, and work down it through the week.
- Choosing questions: 5 numbers with No repeats from the 40 in a chapter's exercise.
- Seating or groups: the whole class's roll numbers in a random order, read off in fours. For named groups, Random Team Generator does it in one go.
On a projector, students see the draw happen, which settles the "why always me?" question.
Big, negative and decimal ranges
From and To can be anywhere between minus one quadrillion and one quadrillion (1015), and negative numbers are fine: -5 to 5 has 11 numbers, zero included. The page draws whole numbers only. For decimals, draw whole numbers and divide: for a number between 0.00 and 1.00 to two places, draw from 0 to 100 and divide by 100. For a random date, number the days, say 1 to 365, and count from the year's first day.
Handy tricks with whole numbers
- An even number between 2 and 100: draw from 1 to 50 and double it. Every even number keeps the same chance.
- A multiple of 5 up to 500: draw from 1 to 100 and multiply by 5.
- A random time of day: draw from 0 to 1439, the minutes in a day, and turn it into hours and minutes: 761 is 12:41.
- Heads or tails, yes or no: draw from 1 to 2, or use Dice Roller and Coin Flip, which says it in words.
- Someone with more tickets: give them more numbers. A family with 5 coupons out of 300 has 5 numbers in the range, and so 5 chances in 300.
The chances, worked out
With N tickets and one winner, each ticket's chance is 1 in N: 1 in 312 at the society's fair below. Holding k tickets makes it k in N. With several prizes and No repeats, a ticket's chance of winning one of them is the number of prizes divided by N: 3 in 312, a little under 1%. Without No repeats, a ticket can win twice, which is why most draws tick it.
Two people picking the same number is likelier than people expect: with 23 people each picking a number from 1 to 365, it is more likely than not that two pick the same one, the famous birthday puzzle. That is no fault of the generator; it is how chance works, and a reason to tick No repeats whenever numbers must differ.
Keeping a record
A draw from a secure random source can't be repeated or predicted, so nobody can recreate it afterwards, not even us. That is good for fairness, and it means the record is yours to keep: a photo of the screen with the time, the downloaded list, or a screen recording of the press. For a sample of invoices or forms, file the list with the check. For anything people might question later, record it as it happens.
What fair means here
Fair means every number in the range has the same chance on every draw, and nothing that came before changes the next one. Fair doesn't mean even-looking: ten draws from 1 to 10 often repeat a number and miss others, and a run of high numbers is normal. Over many draws, the counts even out, as our million draws did. A number that "hasn't come up for a while" isn't due: the generator has no memory.
What it isn't for
- Regulated lotteries and prize schemes, which the law often requires to use certified equipment and supervision. Check the rules in your state before running a paid draw.
- Passwords and PINs: use Password Generator, which makes them from letters, numbers and symbols, and check one you already use with Password Strength Checker.
- Gambling, which this site doesn't support.
A worked example: a society's Diwali draw
A housing society sold 312 coupons for its Diwali fair, numbered 1 to 312, with three prizes. On the evening, the secretary puts the page on a projector, sets From 1, To 312, How many 3, ticks No repeats and leaves Sort them unticked, and announces that the first number wins the first prize. One press gives three different numbers in large figures. The secretary photographs the screen with the room's clock in view, reads the winners out, and posts the photo in the society's WhatsApp group, so families who left early can see the draw for themselves.
Private: drawn on your device
The numbers are drawn inside your browser from your device's own secure random source. Your numbers are never sent to us, no draw is recorded by the page, and once loaded it works with the internet switched off. Google's ad code runs on the page too, but our code never gives it your numbers. How we prove it shows how anyone can check.
Problems and fixes
- "Make To bigger than From."
- The two numbers are the wrong way round. Swap them.
- "Only 5 different numbers lie between them."
- No repeats was asked for more numbers than the range holds. Widen the range or ask for fewer.
- The same number came up twice
- No repeats was unticked. That is normal for independent draws; tick it if every number must differ.
- I need decimals
- Draw whole numbers and divide, as in Big, negative and decimal ranges.
- I need the same numbers again tomorrow
- A secure draw can't be repeated; that is the point of it. Save the list. For research that must be repeated exactly, statistics software with a seed, such as R's set.seed, is the right tool.
Limits
- Whole numbers only, between minus and plus one quadrillion.
- Up to 10,000 numbers at a time.
- The page keeps no record of draws: save the screen or the list yourself.
Other ways
Excel and Google Sheets have RANDBETWEEN(1,100) for one number at a time, though numbers change every time the sheet recalculates, which makes them awkward for a draw. Search engines show a quick number picker for "random number". Paper tickets in a box are still the most visible draw for a small crowd. This page adds no repeats, sorting, up to 10,000 numbers, a downloadable list and a secure random source.
Terms explained
- Random
- Impossible to predict: each outcome has its set chance, whatever happened before.
- Uniform
- Every number in the range equally likely.
- Without replacement
- Drawing so that nothing can come up twice, like tickets not put back in the box.
- Chi-square test
- A standard test of whether counts are as even as chance allows.
- crypto.getRandomValues
- The browser's secure random number source.
- Remainder bias
- The tilt towards the lowest numbers of a range that a plain remainder gives, when the source's count of values isn't a multiple of the range's size.
- Seed
- A starting value that makes a generator repeat the same numbers; a secure source has none that anyone can set.