Random Number Generator
Fill in the fields and the answer appears here.
About this tool
Not Math.random
The obvious way to write this would use Math.random, and browsers make no promise at all about its quality — it is specified only as “implementation-dependent” and has historically been poor in several engines.
This uses crypto.getRandomValues, the browser’s cryptographic generator. For picking a raffle winner or an order of speakers, the difference is one you will never see; for anything anyone might dispute, it is the difference between a defensible draw and a plausible one.
Why a modulo would skew the result
Turning a 32-bit random value into a number from 1 to 100 with a remainder looks correct and is not quite. 232 does not divide by 100, so the first 96 values in the range come up very slightly more often than the last four.
The bias is tiny and it is real. This generator throws away values that fall in the incomplete final bucket and draws again, which costs nothing and makes every number in the range equally likely.
With or without repeats
Repeats allowed is the right setting for dice, for simulations, and for anything where each draw is independent. Without repeats is what a raffle needs — the same ticket cannot win twice.
Asking for more unique numbers than the range contains is impossible rather than slow, and the tool says so instead of running forever.
Nothing is sent anywhere
Every figure on this page is worked out in your own browser. No request is made, nothing is stored between visits, and the page keeps working with the connection switched off.
Frequently asked questions
Is this random enough for a prize draw?
For an informal one, comfortably. It uses the browser's cryptographic generator with the sampling bias removed. For anything legally regulated, use whatever your jurisdiction requires — that is a question about rules and auditing, not about mathematics.
Can I get the same numbers again?
No, and that is deliberate. There is no seed, because a reproducible draw is a different tool for a different purpose. Copy the result if you need to keep it.
Are both ends of the range included?
Yes. From 1 to 100 can produce 1 and can produce 100. Off-by-one at the boundaries is the classic bug in this kind of tool, and the range here is inclusive at both ends.
Is anything sent anywhere?
No. The numbers are generated in this tab and never leave it.
Related tools
- BMI CalculatorBMI, its band, and what that band means at your height.NUMBERS
- Tip CalculatorTip, total and the split, without doing it at the table.NUMBERS
- Discount CalculatorSale price, saving, and what you are really paying.NUMBERS
- Percentage CalculatorThree percentage questions, each with the sum written out.NUMBERS
- Days Between DatesDays, weeks, months and working days between two dates.DATES
- Age CalculatorExact age in years, months and days, plus the next birthday.DATES