Random number
Choose the range and how many, and the numbers are drawn with randomness nobody can predict.
Result
Press Generate to draw.
How it works
The numbers are drawn from the browser’s cryptographic random source, the same one used for passwords and encryption keys. The ordinary JavaScript random function is predictable to anyone who has seen enough of its output, so it will not do for a draw.
Every number in the range is exactly as likely, both limits included. A simple remainder would favour the lowest numbers; here the draws that would cause that bias are discarded and drawn again.
Without repeats, each number can come up only once, as if drawn from a hat. That is right for raffles and for splitting a list. With repeats, the same number can come up again, like rolling a die over and over.
Nothing is stored and nothing is sent anywhere. Press again for a new draw.
How bias is avoided
The browser supplies a whole number between 0 and 4,294,967,295. For the range 1 to 100, 100 goes into the 4,294,967,296 possible values 42,949,672 times with 96 left over. If the number were simply divided by 100 and the remainder used, 1 to 96 would each get 42,949,673 chances and 97 to 100 one fewer. The tool therefore discards the top 96 values and draws again, which happens about twice in a hundred million draws.
NIST describes similar discard methods in SP 800-90A and states that they produce numbers with no bias at all, whereas a simple remainder method is only acceptably even if the random number has at least 64 more bits than the range needs.
No repeats: two routes to the same result
When the count times four is smaller than the size of the range, numbers are drawn one at a time and duplicates are drawn again. Otherwise the whole range is shuffled with the Fisher–Yates method and the first numbers are taken. Both routes make every combination equally likely. The fields take whole numbers between −1,000,000,000,000,000 and 1,000,000,000,000,000, and an empty field is not accepted. A thousands separator such as 1,000 is read as a thousand. If the range holds more than 4,294,967,296 numbers, two numbers from the browser are combined into 53 random bits, with the same discarding. The order of From and To does not matter: 10 to 1 is the same range as 1 to 10.
Example: the lottery quick pick
The quick pick draws 6 numbers from 59. Since 6 × 4 is 24, less than 59, the numbers are drawn one at a time. On average 6.27 draws are needed to get six different numbers, because a number already drawn sometimes comes up again.
There are 45,057,474 different lines of six numbers from 59, and every line has the same chance: one in 45,057,474. Sorting the numbers in order only changes how the line is shown, not which numbers were drawn.