Pick a number from any range you like.
Random number generator
โ
Anything from 1 to 100, all equally likely
Weekly lucky numbers
WeeklyA fresh line for the draw you play, every week, with the seed so you can check we did not cherry-pick it.
Try also
How do you generate a random number in a range without bias?
Draw random bytes from a cryptographic generator, then throw away the values that would not
divide evenly into your range and draw again. That last step โ rejection sampling โ is the
entire difference between a fair generator and a plausible-looking one. Take a random byte from 0
to 255 and reduce it with % 6: the values 0 to 3 each arise 43 times out of 256 while 4 and 5
arise only 42, so the low numbers come up about 2% more often. Discard the four leftover values
and the bias vanishes.
Set the range with min and max, both inclusive, so 1 to 100 really can return 1 or 100. Two switches decide what you get: unique stops the same number appearing twice โ what you want for drawing entry numbers โ and sort puts the results in ascending order.
Uniqueness has a hard limit: you cannot draw ten unique numbers from a range of six. Widen the range or lower the count.
The settings that matter are the two checkboxes, and they change what the draw means rather than how it looks.
| Range | Count | Unique | What you get |
|---|---|---|---|
| 1โ2 | 1 | โ | A coin flip with extra steps |
| 1โ6 | 1 | โ | A six-sided die |
| 1โ100 | 1 | โ | The default: a single pick, repeats possible |
| 1โ500 | 1 | โ | A giveaway draw by entry number |
| 1โ50 | 5 | on | Five different entries, no repeats |
| 1โ49 | 6 | on + sorted | A lottery line, tidily ordered |
That last row is a lottery quick pick built by hand โ the lottery number generator does the same job with bonus balls and a format picker attached. For die-shaped ranges the dice roller is faster, and for a list of names rather than numbers, the random name picker skips the numbering step entirely.
Frequently asked questions
What is the difference between this and Math.random?
Math.random is a fast pseudo-random generator: it produces a sequence from an internal state, and it is not designed to be unpredictable. crypto.getRandomValues is a cryptographically secure generator seeded from the operating system, intended for keys and passwords. For a giveaway or a draw, the second is the one you want, and it costs nothing extra to use.
Are min and max included in the results?
Yes โ both ends are inclusive, so a range of 1 to 100 can return either 1 or 100, and a range of 5 to 5 will return 5 every time. This trips people up because several programming languages exclude the upper bound by default; here the range means exactly what it reads as.
How do I draw numbers without duplicates?
Tick unique. The generator then draws without replacement, so five numbers from 1 to 50 are guaranteed to be five different numbers. It is the correct setting for picking entry numbers in a giveaway, choosing rooms or seats, or selecting several distinct items from a numbered list โ anywhere a repeat would be a bug rather than a result.
Can I use it to pick a giveaway winner?
Yes, and for large entry lists it is the most practical method. Number the entries from 1 to however many there are, set the range to match, draw once on camera, and announce the number before you look up who it belongs to. For lists short enough to read on screen, the random name picker is more convincing to an audience.
What is the biggest range it handles?
Comfortably beyond anything a draw needs โ millions of entries are no problem, since the cost of a draw does not grow with the size of the range. What does have a practical ceiling is the count with unique switched on, because the generator must fill every slot from a shrinking pool; keep the count well below the range size and it is instant.
Can the same number come up twice in a row?
Certainly, unless unique is on, and it is not a fault. Each draw is independent, so a range of 1 to 10 repeats itself about one time in ten. Any generator that refused to repeat would be predictable in exactly the way a random one must not be โ after a 7, you would know the next number was not a 7.
How the randomness works
crypto.getRandomValues, the browser’s cryptographically secure generator,
and mapped onto your inclusive range using rejection sampling โ values that fall outside the
largest whole multiple of the range size are discarded and redrawn, which removes the modulo bias
that would otherwise favour the low end of the range. With unique enabled, drawing is done without
replacement so no value repeats within a set; sorting is applied after the draw and never
influences it. Every number is generated in the page, and nothing is stored or transmitted.Worked example
With From 1, To 100, How many numbers 1, this page works out โ. Anything from 1 to 100, all equally likely
Sources:
The number is the easy part
A number generator is the most flexible tool on this site precisely because it says nothing about what the number means. Numbering your entries and drawing an integer is how large raffles are run, how audit samples are selected, and how anything too long to fit on a wheel gets decided.
Two habits make a draw defensible. Publish the mapping before you draw โ the numbered list of entrants, in a fixed order, timestamped somewhere other people can see. And draw once, in one visible action. A generator is only as trustworthy as the process around it, and almost every dispute about an online draw is about the list, not the number.
What it will not do is tell you how many to draw or what to do about a winner who never replies. Decide those before you press the button and write them down; drawing a replacement afterwards without a stated rule is where informal giveaways lose the room.