Generate truly random numbers within any range. Pick a single integer for quick use, or switch to the comprehensive version for bulk generation, decimal precision control, and more.
Enter a lower and upper limit, then click Generate to produce a random integer within that range.
Generate multiple random numbers at once. Switch between integers and decimals, and control the number of decimal places.
How do I get a random number between 1 and 50 without getting the same one twice? This tool cannot promise that, because each draw is independent, and knowing why will save you from a bad raffle. It has a quick one-number box and a bulk section that produces up to 10,000 integers or decimals within limits you choose, with the decimal places set by you.
Take the default range of 1 to 100. Suppose the browser's random source hands back 0.7342. Multiply by 100 to get 73.42, drop the fraction to get 73, and add the lower limit of 1. The box shows 74.
The first step counts the possible outcomes: max − min + 1 = 100 − 1 + 1 = 100. The +1 matters, because without it the upper limit could never appear. The second step is floor(r × count) + min. The raw value r can be 0 but never exactly 1, so r = 0 gives 1 and r = 0.9999 gives 100, which means both limits are reachable and equally likely.
Decimal mode uses a different formula: r × (max − min) + min, then rounding to the number of places you chose. For limits 2.5 and 7.5 with 2 places and r = 0.3141: 0.3141 × 5 = 1.5705, plus 2.5 is 4.0705, which rounds to 4.07.
That rounding has a side effect at the edges. A value can only round to the lower or upper limit from one side, so those two get half a bin each. In a 2-million-draw simulation of limits 0 and 10 at zero decimals, 0 and 10 each turned up about 5% of the time, while 1 through 9 each turned up about 10%. Integer mode does not have this problem.
Repeats are the other thing to expect. Because every draw is independent, ten integers between 1 and 100 contain at least one repeat with probability 1 − (100 × 99 × ... × 91) / 100^10, which is about 37.2%. Five numbers from 1 to 50 repeat about 18.6% of the time.
There is no unique option. For something like a raffle, generate more numbers than you need, remove repeats by hand, and keep the first ones you have left. For a very small range, writing the values on slips and drawing is simpler.
They come from the browser's pseudo-random generator, which is excellent for games, sampling and choosing who goes first. It is not a cryptographic source, so do not use it for keys, passwords or anything where someone might try to predict the output.
In integer mode, and in the single-number box at the top, both limits must be whole numbers, so 1.5 is rejected. Switch the bulk section to Decimal if you want fractional limits. A lower limit larger than the upper limit is also refused.
Yes. Limits of -5 and 5 give 5 − (−5) + 1 = 11 possible values, and each is equally likely. Just make sure the lower box holds the more negative number.
Rounding gives the lower and upper limit only half the range that every other value gets, so each shows up about half as often. If both ends must count equally, use Integer mode or pick limits slightly wider than you need.