Calculator
Random numbers
Drawn with your browser's cryptographic generator, and corrected for the bias that most implementations leave in. Nothing leaves this page.
Press Draw to get numbers.
The bias almost every generator has
Getting a number between 1 and 45 looks trivial: take a random 32-bit value and divide by 45, keeping the remainder. That is what most code does, and it is slightly wrong.
There are 4,294,967,296 possible 32-bit values, and 45 does not divide into that evenly — there are 16 left over. Those 16 spare values fall on the first 16 outcomes, so numbers 1 to 16 come up marginally more often than 17 to 45. The effect is tiny for small ranges and grows as the range does, and it is completely invisible to the eye: the numbers still look shuffled.
This page removes it by rejection: values that fall in the uneven tail are thrown away and a new one is drawn. It costs a negligible number of extra draws and makes every outcome exactly as likely as every other. The result is verified with a chi-squared test on sixty thousand draws.
Why not Math.random
Math.random makes no promises. The specification does not require any particular quality, browsers implement it differently, and in some engines the sequence can be reconstructed from a handful of earlier outputs. For deciding who goes first in a game that is fine; for drawing numbers people care about it is the difference between random and looking random.
This uses crypto.getRandomValues, which draws from the operating system's entropy source — the same one used for encryption keys.
Drawing without repeats
Picking 6 distinct numbers from 1 to 45 is a shuffle, not six draws. Done naively it means building the whole range in memory and shuffling it, which is fine for 45 and hopeless for a range of a hundred million. This page uses a partial shuffle that only records the positions it actually touches, so drawing 5 numbers from a range of 100,000,000 takes five steps rather than a hundred million.
Nothing is recorded
The draw happens in your browser. No request is made, no result is stored, and refreshing the page loses it. If the numbers matter to you, write them down.