Random Number Generator

Pick random numbers in any range, with or without duplicates, sorted or not.

Presets:
–

How to use the Random Number Generator

  1. Enter the minimum and maximum values (both included).
  2. Choose how many numbers to generate and whether duplicates are allowed.
  3. 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

  1. Close entries and number them in a fixed order, such as the order they arrived.
  2. Announce the range and the number of winners before you draw.
  3. Generate the numbers on screen, or record the draw, so entrants can see it was fair.
  4. 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.

Frequently asked questions

They come from your browser's cryptographically secure random number generator, which is suitable for security purposes and far less predictable than Math.random().

Yes. Turn off "Allow duplicates" and each number in the range can only be picked once. The count cannot exceed the size of the range.

Yes, any whole numbers between −1,000,000,000 and 1,000,000,000 are supported.

Set the minimum to 1 and the maximum to 100, choose how many numbers you need and generate. Choose no duplicates when you are drawing raffle tickets or lottery numbers so each number can come up only once, or switch to dice mode to roll any number of dice. Every result in the range is equally likely.