Random Number

Generate fair random numbers in any range, one or many at a time, with or without repeats - powered by real cryptographic randomness.

Result

-

How it works

Pick a minimum and maximum, choose how many numbers you want, and decide whether repeats are allowed. Every draw uses crypto.getRandomValues - the same secure random source browsers use for cryptography - rather than Math.random. To keep it truly fair, the code uses rejection sampling: if a raw random value falls in the small "leftover" region that would skew a plain modulo, it is discarded and a new one drawn. The result is that every number in your range comes up with exactly equal probability.

With or without duplicates

Leaving allow duplicates ticked draws each number independently, so a value can appear more than once - the right choice when you are simulating dice or coin tosses. Unticking it draws without replacement, guaranteeing every number in the result is unique. That is what you need for a lottery line, a raffle or picking distinct table numbers. When duplicates are off, the count cannot exceed the size of the range: you cannot pick 10 unique numbers from 1 to 5.

Everyday uses

  • Lottery line - 1 to 59, six numbers, no duplicates.
  • Dice roll - 1 to 6, one number, duplicates allowed.
  • Random percentage - 0 to 100, one number.
  • Pick a winner - 1 to the number of entrants, one number.
  • Shuffle order - 1 to N, N numbers, no duplicates.

Need to draw from a list of names rather than numbers? Use the random picker. For quick yes-or-no decisions try the coin flip, or for tabletop games the dice roller handles d4 through d100.

Frequently asked questions

Are the numbers really random?
They are cryptographically secure. The generator uses the browser Web Crypto API (crypto.getRandomValues) with rejection sampling, which removes the slight bias a plain modulo would introduce. Every value in your range is equally likely, so it is fair for draws, giveaways and games.
How do I pick lottery numbers?
Set the minimum to 1, the maximum to your game size (for example 59), the count to how many balls are drawn (say 6), and untick "allow duplicates" so no number repeats. Hit generate for a fair, unique set.
What does "allow duplicates" do?
With it ticked, each number is drawn independently, so the same value can appear more than once - like rolling a die repeatedly. Untick it to draw without replacement, so every number in the result is unique, which is what you want for raffles and lotteries.
Can it generate negative numbers?
Yes. Set a negative minimum, such as -50 to 50, and the generator handles it. Both the minimum and maximum can be negative, positive or zero, as long as the minimum is not greater than the maximum.
What is the largest range it supports?
You can use any whole numbers up to about 9 quadrillion (the safe integer limit), and the range between them can be just as large. Results stay exact - no rounding or floating-point drift.