Random number generator
One number, or a whole set without repeats, in any range you choose.
Set the lowest and highest value you want, then generate. Numbers come from your browser cryptographic random source, so the result is genuinely unpredictable rather than a shuffled sequence.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Type the minimum and maximum in the two boxes.
- Press Generate number for one value, or Generate 6 unique for a set with no repeats.
- Press Copy to take the result.
What this tool does
Generate number returns one whole number, including both ends of the range. A range of 1 to 6 can return 1 or 6, not just the values between them.
Generate 6 unique returns six different numbers from the range with no repeats — the lottery-style draw. If the range is too small to hold six different values, you get as many as fit.
Generate 20 numbers returns twenty values with repeats allowed, one per line, which is handy for test data or a quick simulation.
Why modulo bias matters
Most quick implementations take a random number and use the remainder to squeeze it into a range. That introduces a small but real bias: when the range does not divide evenly into the source, the first few values come up slightly more often than the last few.
This generator throws away values that fall in the uneven tail and draws again, so every number in your range is equally likely. It costs a fraction of a millisecond and removes the problem entirely. Most online generators do not bother, and for a dice roll nobody notices — for a prize draw, it is the difference between fair and nearly fair.
Examples
| Range | Action | Typical result |
|---|---|---|
| 1 – 100 | Generate number | 73 |
| 1 – 49 | Generate 6 unique | 4, 11, 23, 28, 39, 45 |
| 1 – 6 | Generate 20 numbers | a column of twenty dice rolls |
When you need it
- Picking a winner when entrants are numbered.
- Lottery-style number sets, where repeats are not allowed.
- Test data: twenty prices, ages or quantities to paste into a spreadsheet.
- Games: any dice or spinner you do not have to hand.
- Sampling: choosing which rows of a long list to check by hand.
Doing it without this tool
Excel and Google Sheets. =RANDBETWEEN(1,100) gives one number; press F9 to redraw. For a set with no repeats you need a helper column of =RAND() and a sort, because RANDBETWEEN happily repeats itself.
Python. random.randint(1,100), or random.sample(range(1,50),6) for a set without repeats.
Command line. shuf -i 1-100 -n 1 on Linux and macOS.
Privacy: the numbers are generated on your device
No request is made when you press generate. The values are produced by your own browser, are not logged, and disappear when you close the tab. The page keeps working with the network switched off.
Related tools
Frequently asked questions
Yes. A range of 1 to 6 can return 1 or 6, so it behaves like a real die rather than cutting off the top value.
It uses the browser cryptographic random source, which is designed to be unpredictable, and it removes modulo bias so every value in the range is equally likely.
With Generate number, yes — each press is independent. Use Generate 6 unique when repeats are not allowed.
Any whole numbers your browser can represent exactly, which is well beyond nine quadrillion. Ordinary use will never reach it.
Not yet — results are whole numbers. Multiply your range by ten or a hundred and divide the answer yourself if you need one or two decimal places.
No. Nothing is sent to a server and nothing is kept after you close the page.