Random Number Generator
Need a random number? Set the range and how many you need and you will get fair, unbiased picks. Perfect for draws, dice, and codes.
TL;DR
- The generator uses a pseudo random algorithm with uniform distribution.
- Bounded Integer Formula: Integer = Math.floor(PRNG() × (Max - Min + 1)) + Min
- SuperEnalotto / 6 out of 90 Lotteries — Set Range: Min = 1, Max = 90
How it works
The generator uses a pseudo random algorithm with uniform distribution. Every number in your range has the same chance.
The math
The count of outcomes is Max minus Min plus one. Probability of any single number is one divided by that count.
Scales the continuous floating-point interval [0, 1) to the desired integer span [Min, Max] without introducing modulo bias.
Examples
SuperEnalotto / 6 out of 90 Lotteries
- Set Range: Min = 1, Max = 90
- Quantity = 6 numbers
- Mode: Unique Numbers (No Duplicates)
- Sort: Ascending
Dice Roll Simulation
- Set Range: Min = 1, Max = 6
- Quantity = 1 (or 2 for double dice)
Secure OTP / PIN Code (1000, 9999)
- Set Range: Min = 1000, Max = 9999
- Quantity = 1 number
- Mode: Allow Duplicates (single draw)
- Press Calculate to generate the code
Random Seat / Team Assignment (1, 10)
- Set Range: Min = 1, Max = 10
- Quantity = 10 numbers
- Mode: Unique Numbers (No Duplicates)
- Sort: Ascending, ready to assign
When to use it
✦ Contests, Raffles & Giveaways
Select winning ticket numbers transparently without human bias.
✦ Statistical Sampling
Select random subsets of data for scientific research and A/B testing.
✦ Passwords & Security Codes
Generate numeric OTPs, PINs and verification codes instantly, free of human bias.
✦ Simulations & Experiments
Run Monte Carlo-style simulations or classroom probability experiments with uniform, repeatable draws.
⚠ Common mistakes
- Confusing Allow Duplicates with Unique Draws: Selecting multiple lottery numbers with duplicates allowed can result in identical numbers in a single pick.
- Forgetting the exact range: expecting values outside [Min, Max] (for example 0, 10 when Min = 1) produces results you did not intend. Always double-check the interval before drawing.
FAQ (4)
Is this random number generator suitable for lotteries?
Yes, it produces independent uniform random draws ideal for lotteries, raffles, games, and random picks.
Can I generate negative numbers?
Yes, set Min to a negative value (e.g. Min = -10, Max = 10) and the generator will draw from the full closed interval, including negative values.
Why do I sometimes get the same number twice?
Because every draw is independent when 'Allow Duplicates' is active. Enable 'Unique Numbers' whenever you need non-repeating values, such as samples or seat assignments.
Is the generator unbiased for raffles?
Yes, the uniform distribution means every integer in the interval has exactly the same probability, making the tool suitable for fair raffles, lotteries and random selections.