Random Number Generator

Generate random whole numbers in any range: single picks or lists, with or without repeats.

The Random Number Generator picks one or more random numbers between any minimum and maximum you choose. Generate up to 1,000 numbers at once, choose whole numbers or decimals, and turn on unique values so that no number repeats. That makes it suitable for lucky draws, raffle and giveaway winners, roll-number selection, classroom games, sampling survey respondents, board games and choosing who goes first.

How to use the random number generator

  1. Set the minimum and maximum. Both are inclusive for whole numbers, so 1 to 6 can return 1, 2, 3, 4, 5 or 6.
  2. Choose how many numbers you need (1–1,000).
  3. Choose whole numbers or decimals (shown to 4 decimal places).
  4. Set unique values only to “Yes” if repeats are not allowed, for example when choosing 3 different winners from 250 entries.
  5. Press Generate. Press it again for a new set.

How it works

The tool uses your browser’s built-in pseudo-random number generator (Math.random()). It produces values that are evenly spread across the range and pass standard statistical tests for everyday randomness. A whole number between min and max is produced as:

n = floor(random × (max − min + 1)) + min    where 0 ≤ random < 1

For unique picks, the generator draws repeatedly and throws away any number it has already used, which is equivalent to drawing slips from a bowl without putting them back.

Not for security: don’t use this tool to create passwords, OTPs, encryption keys or anything a determined attacker might try to predict. Those need a cryptographically secure generator such as crypto.getRandomValues() or a password manager.
UseMinMaxHow manyUnique?
Roll a die161Not needed
Roll two dice162No
Coin toss (1 = heads, 2 = tails)121Not needed
Pick 3 winners from 250 entries12503Yes
Random roll number in a class of 601601Not needed
Shuffle the order of 10 teams11010Yes
Housie / tambola numbers19090Yes
Random 4-digit number100099991Not needed

Running a fair lucky draw or giveaway

  1. Number every entry in a spreadsheet (1 to N), and freeze the list before the draw.
  2. Announce the method: “Winner chosen with a random number generator between 1 and N.”
  3. Draw live or screen-record the draw so participants can see it was fair.
  4. Use unique values for multiple prizes and decide in advance which number gets which prize.
  5. Pick a few reserve winners in the same draw in case a winner is ineligible or doesn’t respond.

Probability basics

With a range of N whole numbers, each number has a 1/N chance on each draw. Some useful facts:

  • The chance of rolling a 6 is 1/6 ≈ 16.7%. The chance of rolling at least one 6 in four rolls is 1 − (5/6)4 ≈ 51.8%.
  • Past results don’t affect the next draw. After five “tails”, heads is still 50%. Believing otherwise is called the gambler’s fallacy.
  • Birthday paradox: draw 23 numbers from 1–365 with repeats allowed, and there is about a 50% chance two will match. Repeats appear sooner than most people expect.

Random sampling for surveys and research

To pick a simple random sample, number every member of the population (for example, 1–1,200 employees), then generate the sample size you need with unique values on. Every person has the same chance of being chosen, which avoids selection bias. For stratified samples, such as equal numbers from each department, run the generator separately for each group.

Frequently asked questions

Is this random number generator truly random?

It uses the browser’s pseudo-random generator, which is statistically random and fine for games, draws and sampling. It is not cryptographically secure, so don’t use it for passwords or security codes.

How do I generate random numbers without repetition?

Set “Unique values only?” to Yes. Each number then appears at most once, like drawing slips from a bowl without replacing them. The range must contain at least as many numbers as you ask for.

Are the minimum and maximum included?

Yes, for whole numbers both ends are included. A range of 1 to 10 can return 1 or 10. For decimals, values range from the minimum up to just below the maximum.

How do I pick a random winner for a giveaway?

Number all valid entries from 1 to N, set the minimum to 1 and the maximum to N, and generate one number, or several unique numbers for multiple prizes. Record the draw for transparency.

Can I generate negative random numbers?

Yes. Use a negative minimum, for example −50 to 50.