Lottery style picks and the odds of the line you draw
A lottery line is a no repeat draw, sorted low to high, sometimes with a bonus ball from a second pool. That is exactly what this generator does with repeats off, so each game below can be loaded straight into the tool. The odds column is the chance that one line matches every ball, which is the number of possible lines: the combinations of the main pool multiplied by the combinations of the bonus pool.
| Game | The draw | Jackpot odds per line | Any prize | Relative odds | Load |
|---|---|---|---|---|---|
| Lotto 6/49 | 6 from 49 | 1 in 13,983,816 | about 1 in 6.6 | Shortest | |
| UK Lotto | 6 from 59 | 1 in 45,057,474 | 1 in 9.3 | 3.2 times longer | |
| EuroMillions | 5 from 50, plus 2 Lucky Stars from 12 | 1 in 139,838,160 | about 1 in 13 | 10 times longer | |
| Mega Millions | 5 from 70, plus 1 Mega Ball from 24 | 1 in 290,472,336 | see operator chart | 20.8 times longer | |
| Powerball | 5 from 69, plus 1 Powerball from 26 | 1 in 292,201,338 | 1 in 24.87 | 20.9 times longer |
Relative odds compare each jackpot with Lotto 6/49. Mega Millions shrank its Mega Ball pool from 25 to 24 on 8 April 2025, which moved its jackpot odds from about 1 in 302.6 million to the figure above. Matrices change, so the operator's own chart is the final word before you buy.
What the note under your result is telling you
Every draw prints one line of probability under the big number, and which line you get depends on the settings. A single number reports its plain chance, 1 in the size of the range. A no repeat draw reports how many different sets of that size the range holds, which is the same count a lottery uses, so 6 unique numbers from 1 to 49 gives the familiar 1 in 13,983,816. A draw with repeats allowed reports the chance that at least one value appears twice, because that is the number people are surprised by: 20 draws from 1 to 100 contain a repeat 86.96% of the time.
Sorting never changes any of these figures. Low to high is only a way of reading the set, the same way a lottery prints its balls in order after the machine has drawn them in whatever order they fell.
How this random number generator draws fair numbers
Ranges, decimals, no repeat draws, sorting, lottery odds and the browser randomness behind every result
A random number generator has one job: every value in the range you set must have exactly the same chance of coming up, and nobody, including the page itself, should be able to guess the next one. Most tools get the first part roughly right and say little about the second. This one draws from your browser's cryptographic source, maps the result into your range without bias, handles whole numbers and decimals, refuses impossible no repeat requests instead of quietly failing, and prints the odds of whatever it just drew.
How to use the generator
Set the lowest and highest number with the sliders, or type into the box under each slider for anything outside the slider's reach, including negative limits and ranges far wider than 1,000. Both limits are included, so a range of 1 to 100 can return 1 and can return 100. Choose how many numbers you want, from 1 up to 10,000 in one draw. Leave decimal places at zero for whole numbers, or raise it to get values such as 0.37 or 12.4081. Then pick whether repeats are allowed and whether the list should stay in draw order or be sorted low to high or high to low, and press Generate.
A single number appears large in the result panel. A short set, eight values or fewer, appears there too, and anything longer is summarised in the panel with the full list underneath, ready to copy as a comma separated line. The Quick start buttons load common setups, including two complete lottery lines, and the table below the tool loads any of five lottery games in one click.
With repeats or without: two different kinds of draw
With repeats allowed, each number is drawn independently, like rolling the same die again and again. Earlier results have no effect on later ones, so the same value can come up twice in a row, and over a long list it will. RANDOM.ORG describes its own integer generator the same way and points people who need distinct values to a separate sequence tool. Here the switch is on the same form.
With no repeats, the draw behaves like pulling numbered balls from a bag and not putting them back. The generator runs a partial Fisher-Yates shuffle over your range: it picks a random position among the values not yet used, swaps it to the front, and repeats for as many numbers as you asked for. Ronald Fisher and Frank Yates described the method in 1938 and Richard Durstenfeld adapted it for computers in 1964. It is exact, it takes one step per number drawn, and every possible set of that size is equally likely. Because it only remembers the positions it has moved, it can draw 10 unique numbers from a range of a trillion as quickly as 10 from 50.
A no repeat draw has a hard ceiling. A range of 1 to 10 holds ten values, so asking for eleven different ones cannot succeed. Many generators respond by looping, returning fewer numbers than requested, or slipping a duplicate in. This one stops and tells you the exact count the range holds, so you can widen the range, lower the count or switch repeats back on. The same ceiling applies to decimals: 0 to 1 at one decimal place holds only eleven values, 0.0 to 1.0.
Why repeats turn up sooner than you expect
If you draw 20 numbers from 1 to 100 with repeats allowed, the list will contain at least one duplicate 86.96% of the time. Ten draws already give 37.18%, and twelve give 49.68%. This is the birthday problem: in a group of 23 people there is a 50.7% chance that two share a birthday, because 23 people form 253 pairs and each pair is a separate chance of a match. The rule of thumb is that a repeat becomes more likely than not after about 1.18 times the square root of the range size. For 1 to 1,000 that is 38 draws, where the exact chance is 50.93%. The line above the Generate button shows this count for whatever range you set, and after a draw with repeats on, the note under the result gives the exact chance for your count.
Where the randomness comes from
Browsers offer two sources. Math.random() returns a decimal from 0 up to but not including 1, and the engine chooses its seed; you cannot set or reset it. In Chrome it has been the xorshift128+ algorithm since Chrome 49 in 2015, which replaced an older generator that could produce only 232 distinct values and, from some seeds, repeated its whole cycle in under 40 million steps. Firefox and Safari adopted the same algorithm. Xorshift128+ has 128 bits of state and a period of 2128 minus 1 and it passes the standard statistical test batteries, but it is not cryptographically secure, so it should not be trusted anywhere someone might gain by predicting a result.
crypto.getRandomValues() is the other source and the only one this page uses. The Web Cryptography specification asks browsers to back it with a well established cryptographic pseudo random generator seeded from high quality operating system entropy. It has been available in every major browser since July 2015. Each call can fill at most 65,536 bytes, so the generator requests 256 values at a time and refills as it goes. If a browser does not offer it, the page says so rather than falling back to Math.random().
Pseudo random, cryptographically secure and true random
A pseudo random number generator, or PRNG, is an algorithm. Given the same starting seed it produces the same sequence every time, and it eventually repeats. That is a feature for simulations, which need to be replayed, and a weakness anywhere a result must not be guessed. A cryptographically secure generator, a CSPRNG, is still an algorithm, but it is built so that seeing past outputs does not help predict future ones, and it is reseeded from physical noise the computer collects. CalculatorSoup's server side generator uses PHP's random_int(), which is this kind.
A true random number generator, or TRNG, measures something physical: thermal noise, jitter in electronic circuits, quantum effects. RANDOM.ORG has used atmospheric noise picked up by radio receivers since 1998. True random sources are slower and cannot be replayed. For drawing a raffle winner, picking a sample or splitting a class into groups, a properly seeded CSPRNG is indistinguishable from a true random source in practice, and it has the advantage of running on your own device, so nobody else sees the draw or its result. The one thing this generator is not for is creating encryption keys; the specification itself says to use the dedicated key generation method for that.
Rejection sampling and modulo bias
A cryptographic source hands out raw 32 bit integers, 4,294,967,296 possible values. Getting from that to a number between 1 and 100 is where many generators introduce a quiet bias. The quick method is to take the remainder after dividing by 100. But 4,294,967,296 is not a multiple of 100: it is 100 times 42,949,672 with 96 left over. So 96 of the hundred outcomes can be reached 42,949,673 ways and the other four only 42,949,672 ways. For a small range the tilt is tiny. For a range of one billion it is not: 232 holds four whole billions plus 294,967,296, so the lowest 294,967,296 values would come up 25% more often than the rest.
Rejection sampling removes the tilt completely. The generator works out the largest multiple of your range size that fits in the raw source, throws away any raw value above it and draws again. Every remaining raw value maps to exactly one outcome the same number of times. For a billion wide range about 6.87% of raw draws are discarded, which costs a fraction of a millisecond. Ranges wider than 232 are built from two raw values joined into a 53 bit number and rejected the same way, which is why the tool can draw exactly across anything up to 9,007,199,254,740,991 steps, the largest whole number JavaScript represents exactly.
Random decimals without rounding errors
The naive way to make a random decimal is to multiply a random fraction by the width of the range and round. Rounding is the problem: MDN warns that building integers with Math.round() gives an uneven distribution, and the same happens with decimal places, because the two end values each collect only half as many results as every value between them. This generator avoids that by treating decimals as whole steps. With two decimal places, 0 to 1 becomes the 101 values 0.00, 0.01 and so on up to 1.00, and one of those steps is drawn exactly as a whole number would be. Both limits can come up, every step has the same chance, and a no repeat decimal draw knows exactly how many values exist.
Sorting, lottery lines and what the odds mean
Sorting a draw does not change it. A lottery machine drops balls in whatever order they fall, and the ticket prints them low to high afterwards; the set is the same either way. The note under a no repeat result gives the chance of that exact set, which is the number of combinations of your count from your range. Six unique numbers from 1 to 49 is one set in 13,983,816, the jackpot odds of Lotto 6/49. Games with a bonus pool multiply the two counts: Powerball's 5 from 69 is 11,238,513 combinations, times 26 Powerball numbers, gives its published 1 in 292,201,338. A line from this page has exactly the same odds as a line you choose yourself. What a random line can change is how many people share a jackpot, because hand picked lines cluster on birthdays and patterns while a random line does not. The EuroMillions operator notes that Lucky Dip lines have identical odds to chosen ones, and a Lucky Dip is simply a random number generator run at the till.
Doing the same in a spreadsheet
Excel can do this too, with two caveats. RAND, RANDBETWEEN and RANDARRAY are volatile, so every edit anywhere in the workbook redraws them; copy the results and paste them as values to freeze a draw. And a draw without repeats needs the dynamic array functions UNIQUE, SEQUENCE and SORTBY, which exist only in Excel 365 and Excel 2021. For anything you need to keep, it is often quicker to generate the list here, press Copy and paste it into the sheet as fixed numbers. For summarising a large random sample afterwards, the statistics calculator and the average calculator take the pasted list directly, and dice rolls with their own notation live on the dice roller.
Frequently Asked Questions
Are the lowest and highest numbers included in the draw?
Yes. Both limits are part of the range, so 1 to 100 holds 100 values and either end can come up with the same 1 in 100 chance as any number in between. The same is true for decimals: 0 to 1 at two decimal places holds the 101 values from 0.00 to 1.00, and both 0.00 and 1.00 can appear. If you type the limits the wrong way round, the generator reads them low to high and says so.
What happens if I ask for more unique numbers than my range contains?
The draw is refused with the exact count the range holds. Twelve different numbers from 1 to 10 is impossible because the range only has ten, so instead of looping, returning a shorter list or slipping in a duplicate, the tool tells you to lower How many, widen the range or allow repeats. Decimals have the same ceiling: 0 to 1 at one decimal place holds only 11 values.
Why did my list repeat a number so quickly when repeats are allowed?
Because repeats arrive much sooner than intuition suggests. Twenty draws from 1 to 100 contain at least one duplicate 86.96% of the time, and twelve draws already reach 49.68%. It is the birthday problem: every pair of draws is a separate chance of a match, and pairs multiply fast. A repeat becomes more likely than not after roughly 1.18 times the square root of the range size. Switch to No repeats if every value must be different.
How is crypto.getRandomValues different from Math.random?
Math.random() is a fast statistical generator: xorshift128+ in Chrome since 2015, an algorithm Firefox and Safari also adopted. It passes randomness tests but is not built to resist prediction, and you cannot seed it. crypto.getRandomValues() is backed by a cryptographic generator the browser seeds from operating system entropy, so past outputs do not reveal future ones. It fills integer arrays of up to 65,536 bytes per call and has worked in all major browsers since July 2015. This page uses only the second.
Do randomly generated lottery numbers win more often than numbers I pick myself?
No. Every line has the same chance: 1 in 13,983,816 for Lotto 6/49, 1 in 292,201,338 for Powerball, whoever chose it. The one practical difference is sharing. Hand picked lines crowd onto birthdays, the numbers 1 to 31 and visual patterns on the slip, so if one of those wins the prize is more likely to be split. A random line has no such bias. The EuroMillions operator makes the same point about Lucky Dip lines.
How are random decimals drawn between two limits?
As whole steps. With three decimal places the generator turns the range into steps of 0.001, draws one step exactly as it would draw a whole number, then places the decimal point. Rounding a random fraction instead would give each end of the range only half the chance of the values inside it. Stepping keeps every value equally likely, lets both limits appear and lets a no repeat decimal draw know how many values exist.
What is modulo bias, and does this generator avoid it?
Modulo bias is the small favouritism that appears when a raw random integer is squeezed into a range by taking a remainder. A 32 bit source has 4,294,967,296 values, which does not divide evenly by 100, so 96 of the hundred outcomes get one extra way to occur. For a one billion wide range the lowest values would be 25% more likely. This generator uses rejection sampling: raw values from the uneven tail are discarded and redrawn, so every outcome is reached exactly the same number of ways.
Does sorting the numbers from low to high make them any less random?
No. Sorting only changes how the set is displayed, not which numbers were drawn or the chance of drawing them. Lottery results are printed in order after the machine has drawn them in random order, and the odds are quoted for the set, not the sequence. Keep draw order when the order itself matters, for example when numbers assign speaking slots or a running order.
Can I get the same set of random numbers again later?
Not by pressing Generate again. The cryptographic source has no seed you can set, which is what makes a draw impossible to reproduce or predict. To keep a result, press Copy and save the comma separated list, or take a screenshot of the result panel if you need to show when a raffle was drawn. If you need a sequence that can be replayed, such as a simulation, use a seeded pseudo random generator in a spreadsheet or a programming language instead.