A random number generator picks numbers by chance, so nobody can predict or influence the result. Use it to choose a winner, draw lottery-style numbers, assign groups, pick a page to read or settle a decision. Set the range, choose how many numbers you need, and press Generate.
How to use the random number generator
- Set the lowest and highest numbers. Both can be picked: 1 to 100 includes 1 and 100.
- Choose how many numbers you want, up to 1,000 at a time.
- Tick No repeats if each number may appear only once, as in a raffle, and Sort if you want them in order.
- Press Generate, and Copy numbers to paste the list elsewhere.
How the numbers are picked
The generator uses your browser's crypto.getRandomValues() function, which MDN Web Docs describes as giving cryptographically strong random values. Each number in the range has the same chance of being picked: values that would make some numbers slightly more likely are thrown away and drawn again. With No repeats on, numbers already chosen are skipped, like drawing tickets from a hat without putting them back.
Ideas for using random numbers
- Giveaways: number the entries and pick a winner.
- Classrooms: choose who answers next, or split a class into teams.
- Games: roll a die with 1 to 6, or pick a card position.
- Sampling: choose survey respondents or items to check at random.
Is it fair?
Yes. The numbers come from your device's secure random source, and nothing is stored or sent to our server, so no one can see or change the results before you do. For a fair draw others can trust, generate the number while they watch, or share your screen.
Random, not patterned
Truly random results often look less random than people expect: the same number can come up twice in a row, and runs of high or low numbers happen. That is how chance behaves. Each new pick is independent of the ones before, so a number that hasn't appeared for a while is no more likely to come up next.
Common ranges
1 to 10 for a quick choice, 1 to 6 for a die, 1 to 100 for a percentage-style pick, and 1 to 49 with six numbers and no repeats for a lottery-style draw. For a strong password instead of numbers, use the password generator.
Worked example: a lottery-style draw
To draw six numbers from 1 to 49 with no number twice:
- Enter 1 as the Lowest number and 49 as the Highest number.
- Enter 6 in How many numbers.
- Leave No repeats ticked, and tick Sort from low to high.
- Press Generate.
The result says “6 numbers”, lists the six numbers in order, separated by commas, and notes that they were picked from 1 to 49. Press Generate again for a new set. Copy numbers copies the list in the same order you see it.
Without Sort, the numbers stay in the order they were drawn. That matters when order means something, such as who goes first in a game.
Settings and limits
- Whole numbers only. The lowest number, the highest number and how many must all be whole numbers. Negative numbers are fine, so you can pick from −50 to 50.
- Range size. Both ends must be within one trillion of zero, and the range can hold up to 4,294,967,296 numbers.
- How many. From 1 to 1,000 numbers each time you press Generate.
- No repeats. You can’t ask for more numbers than the range holds. From 1 to 10, the most you can pick without repeats is 10.
The page opens with a range of 1 to 100, one number and No repeats ticked. Reset brings back those settings and clears the result.
Why each number has the same chance
The browser’s random source gives whole numbers from 0 to 4,294,967,295, which is 4,294,967,296 possible values. To pick from a smaller range, the generator divides and keeps the remainder. That only works evenly when the range divides 4,294,967,296 exactly. For a range of 100 numbers, 96 values are left over at the top, and keeping them would make the lowest numbers in your range very slightly more likely.
So the generator throws those top values away and draws again. For 1 to 100, that happens about 2 times in 100 million draws. For a die from 1 to 6, only 4 values are thrown away. The result is that every number in your range has the same chance.
With No repeats on, the generator keeps drawing and ignores any number it already has, until it has as many different numbers as you asked for.
Cryptographic randomness vs Math.random
Web pages can get random numbers in two main ways. MDN describes Crypto.getRandomValues() as a way to get cryptographically strong random values.[1] MDN also explains that, for speed, browsers use a pseudo-random number generator seeded with a value with enough entropy.[1] Math.random(), the other common method, does not provide cryptographically secure random numbers, and MDN says not to use it for anything related to security.[2] This generator uses getRandomValues(), so the numbers are suitable for draws where people need to trust the result.
| Method | Cryptographically secure | Used here |
|---|---|---|
| Crypto.getRandomValues() | Yes | Yes |
| Math.random() | No | No |
Common mistakes
- Forgetting No repeats for a raffle. Without it, the same ticket number can be drawn twice.
- Typing a decimal. The boxes take whole numbers only, so 1.5 shows an error instead of a result.
- Making the range too small. With No repeats ticked, the range must hold at least as many numbers as you ask for.
What next
Use this often? Add Random Numbe to your Home screen.
Frequently asked questions
How does the random number generator work?
It uses your browser’s cryptographic random source to pick whole numbers between your lowest and highest values, with every number equally likely.
Can I pick numbers without repeats?
Yes. Tick No repeats and each number appears at most once, as long as the range has enough numbers.
Are the lowest and highest numbers included?
Yes. A range of 1 to 100 can pick both 1 and 100.
How many numbers can I generate?
Up to 1,000 numbers at a time.
Does the random number generator use Math.random?
No. It uses your browser’s Crypto.getRandomValues(), which gives cryptographically strong random values. Math.random is not meant for anything where the result must be hard to predict.
Can I generate negative numbers?
Yes. Enter a negative lowest number, such as −50, and the generator picks whole numbers across the whole range, including zero.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.