How the numbers are picked
Each number comes from your browser's cryptographic random generator (crypto.getRandomValues), the same source used for security keys. It's not a simple Math.random().
To make every number equally likely, the generator uses rejection sampling. It draws a random 32-bit value, and if that value falls in the small leftover zone that doesn't divide evenly by the size of your range, it throws it away and draws again.
Here n is how many values are possible. Without this step, a quick x mod n would make some numbers very slightly more likely than others. This is called modulo bias.
Worked example
From 1 to 6 there are n = 6 values. ⌊4,294,967,296 ÷ 6⌋ × 6 = 4,294,967,292, so the top 4 of the 4.29 billion possible draws are thrown away. Every face then has exactly the same chance, 1 in 6.
Decimals work the same way on a grid. 0 to 1 with 2 decimal places means the 101 values 0.00, 0.01, … 1.00, each equally likely.
No repeats
With repeats turned off, it's like drawing numbered tickets from a hat without putting them back. You can't ask for more numbers than the range holds. For example, 1 to 10 has only 10 different numbers.
Limitations
- Up to 10,000 numbers at a time, within ±9,007,199,254,740,991 (the largest whole number JavaScript stores exactly).
- Good for raffles, games, classroom picks and sampling. For an official lottery or a legal drawing, follow the rules that apply to it, which may require a certified process.
- Nothing is saved. Each click of Generate makes a fresh draw.