Random Number Generator
Generate one or more random numbers between any range instantly. Perfect for lotteries, raffles, games, decisions, and statistical sampling.
Part of our Math & Percentage Calculators collection.
Random Number Generator
Free online calculator
How to Use This Calculator
- 1
Set your minimum and maximum values (e.g. 1 and 49 for a lottery).
- 2
Choose how many numbers to generate.
- 3
Select whether duplicates are allowed.
- 4
Click Calculate — results appear instantly.
How Random Numbers Are Generated
Uses JavaScript's Math.random() which generates a pseudo-random float between 0 and 1. Random integer between min and max: Math.floor(Math.random() * (max − min + 1)) + min For unique numbers: generated values are tracked and regenerated if duplicate.
Example Calculation
Example: 6 unique lottery numbers from 1–49
Inputs
minVal: 1maxVal: 49quantity: 6allowDuplicates: no
Result
e.g. 7, 14, 22, 31, 38, 45
6 unique random numbers between 1 and 49, no repeats.
Frequently Asked Questions
Is this truly random?
Math.random() is pseudo-random, not cryptographically random. It's perfectly fine for games, raffles, and decisions. For cryptographic or security purposes, use a dedicated secure random number generator.
Can I use this for lottery numbers?
Yes — set the range to match your lottery (e.g. 1–49 for UK Lotto, 1–69 for Powerball main numbers) and generate the required count of unique numbers.