How to use the Random Number Generator
- Enter the minimum and maximum values (both included).
- Choose how many numbers to generate and whether duplicates are allowed.
- Click Generate. Copy the results or generate again.
About this tool
Whether you are running a giveaway, drawing raffle tickets, choosing a random sample or settling who goes first, you need a random number generator that is genuinely fair. This one uses your browser's cryptographically secure randomness with rejection sampling, so every number in your range is exactly equally likely – no number is favoured, even in awkward ranges.
Set the minimum and maximum (both are included), how many numbers you need, and whether duplicates are allowed. Sort the results if you like, and copy them in one click. Presets fill in common jobs: roll a die, flip a coin (0 or 1), draw 6 numbers from 49 for a lottery, or make a 4-digit PIN.
Common uses
- Giveaways and raffles: number your entries 1 to N, generate one number, and the matching entry wins. For several winners, generate as many numbers as you need with Allow duplicates off, so nobody can win twice.
- Classrooms: pick a student by their register number, or split a class into random groups.
- Lottery-style draws: 6 unique numbers from 1 to 49, sorted.
- Games: roll a die (1–6), or any number of dice by setting the count.
- Sampling: choose 20 random rows from a list of 500 for a survey or a quality check.
Running a giveaway people can trust
- Close entries and number them in a fixed order, such as the order they arrived.
- Announce the range and the number of winners before you draw.
- Generate the numbers on screen, or record the draw, so entrants can see it was fair.
- If a winner does not reply in time, draw again from the remaining entries.
Our guide on how to pick a random winner covers giveaway rules and keeping records.
Why "random" matters
Ordinary programming functions such as Math.random() are fine for games but are not designed to be unpredictable. This generator uses the Web Crypto API, the same source browsers use for security keys. It also uses rejection sampling: random values that would make some numbers slightly more likely are thrown away and redrawn, so a range like 1 to 7 is perfectly even.
Limits
Any whole numbers between −1,000,000,000 and 1,000,000,000 are supported. With duplicates off, the count cannot be larger than the range – you cannot draw 10 unique numbers from 1 to 5.
Need random words or passwords instead? Try the Password Generator, the Passphrase Generator or the Username Generator.