Random Number Generator

Set the lowest and highest numbers and how many you want. Switch on No repeats for a draw where each number can come up once, like a raffle.

How it works

Each number comes from your browser's secure random generator, crypto.getRandomValues, the same source used for passwords and keys.

Values that would make some numbers slightly more likely are thrown away and drawn again, so every whole number in the range has exactly the same chance.

With No repeats on, a number that has already come up is drawn again. When you ask for most of a small range, the tool shuffles the range instead, which gives the same fair result faster.

How to use it

  1. 1 Type the lowest and the highest number. Both are included.
  2. 2 Type how many numbers you want.
  3. 3 Switch on No repeats if each number may come up only once, and pick an order.
  4. 4 Copy the numbers, or download them as a text file. Press Draw again for a new set.

Good to know

  • For a raffle with tickets 1 to 250 and 3 prizes, set 1 to 250, ask for 3 and switch on No repeats.
  • To shuffle the numbers 1 to 30, ask for 30 numbers from 1 to 30 with No repeats.
  • Negative ranges work: −10 to 10 has 21 possible numbers.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Fair random numbers, and how to check a draw is fair

A fair random number generator gives every number in the range the same chance, and gives no hint of the next number from the ones before. Many simple generators fail the second test. JavaScript's Math.random, for example, is fast and fine for animations, but its output can be predicted from a handful of earlier values. This tool uses crypto.getRandomValues instead, which is built for secrets.

The first test is subtler. A computer's random source gives bytes, numbers from 0 to 255. To get a number from 1 to 100, the obvious method takes a byte and finds its remainder after dividing by 100. But 256 is not a multiple of 100, so 1 to 56 each get three chances in 256 and 57 to 100 only two. The tool avoids this by throwing away any byte from the uneven top of the range and drawing again, a method called rejection sampling.

No repeats changes the question from "pick a number" to "draw a ticket from a hat". Take a raffle with tickets 1 to 250 and three prizes. Without No repeats, the same ticket could win twice. With it, the first ticket drawn is set aside before the second is drawn, and so on. Every set of three tickets is equally likely, and the order shown is the order drawn, so you can award first prize to the first number.

When a draw has to be seen to be fair, such as a giveaway or a class rota, run it in front of the people concerned or record the screen. Write down the range and the count before you press Draw again, so nobody can say the settings were changed to suit a result. Pressing until you like the answer is the one way any generator stops being fair.

The tool has limits. It draws whole numbers only, from about minus 9 quadrillion to plus 9 quadrillion, the range where JavaScript stores every whole number exactly. It draws up to 10,000 numbers at a time. It keeps no record of past draws, so it cannot prove afterwards what it drew; save the output if you need a record.

Frequently asked questions

Are these numbers truly random?

They come from a cryptographically secure generator, which is seeded from unpredictable events in your device. Nobody can predict the next number from earlier ones, which is the property that matters for draws and games.

Can I pick lottery numbers with it?

Yes: for a 6 from 59 lottery, set 1 to 59, ask for 6, switch on No repeats and choose Smallest first. Every combination is as likely as any other, so no tool can raise your odds of winning.

Is the highest number included?

Yes. A range of 1 to 6 can give 1, 2, 3, 4, 5 or 6, like a die.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.