Random Number Generator

Generate random numbers free in any range — set Min/Max, pick how many, allow duplicates or sort results. Cryptographically random, private, no sign-up.

  • ✓ Free forever
  • ✓ No sign-up
  • ✓ Private — runs in your browser

Loading tool…

About this random number generator

A random number generator picks fair, unpredictable numbers in any range you choose. Enter a “Min” and “Max”, set “How many” numbers you want, and click “Generate numbers” — perfect for raffles, classroom sampling, game stats, homework probability exercises, and any decision that has to be impartial.

Not all random is equal: basic scripts use Math.random(), a predictable generator that can show patterns and repeats. This tool draws from your browser’s cryptographic generator (crypto.getRandomValues()) with rejection sampling, so every number in your range has exactly the same probability — no bias, no streaks from a bad seed. Everything runs locally on your device, with no sign-up and no limit on how many sets you generate.

How to use it

  1. Enter the "Min" and "Max" values to set your range — for example 1 to 100.
  2. Enter "How many" numbers you want in each set.
  3. Tick "Allow duplicates" if repeats are fine (drawing with replacement); leave it unticked when every number must be unique.
  4. Tick "Sort results" to order the output from smallest to largest — handy when checking against a list.
  5. Click "Generate numbers", then "Copy results" to copy the set to your clipboard.

The method behind it

Each number is drawn from crypto.getRandomValues(), the browser's cryptographic random source. To keep the distribution perfectly uniform, the tool uses rejection sampling: raw random values that would skew the range through modulo bias are discarded and redrawn, so a number like 7 is exactly as likely as any other in your range. When "Allow duplicates" is unticked, the tool uses a partial Fisher–Yates shuffle — the standard algorithm for drawing without replacement — guaranteeing unique picks with equal probability for every possible combination. "Sort results" simply orders the final set; it never changes which numbers were drawn.

Frequently asked questions

Is the output really random?

Yes. Numbers come from crypto.getRandomValues(), a cryptographically secure generator, and rejection sampling removes modulo bias — so every number in your range is exactly equally likely. Unlike Math.random(), the output has no predictable seed or repeating pattern.

How do I get numbers without duplicates?

Leave "Allow duplicates" unticked and set "How many" to no more than the size of your range (Max − Min + 1). The tool then draws without replacement, so every number in the set is unique — ideal for raffles, lotteries, and sampling.

Can I use this for a raffle or giveaway?

Absolutely. Assign each entry a number from 1 to N, set "Min" to 1, "Max" to N, "How many" to the number of winners, leave "Allow duplicates" unticked, and click "Generate numbers". Because the draw is cryptographically uniform, every entry has a provably equal chance — as fair as a physical draw.

Why would I tick "Sort results"?

Sorting does not change which numbers were drawn — it just lists them smallest to largest. That makes it much easier to scan the set, check it against a list of entries, or spot the full spread at a glance, especially with large sets.

Worked example

Draw 5 unique numbers from 1–50, lottery-style. The number of possible sets is C(50,5) = 2,118,760 — so any specific combination (say 4, 12, 23, 31, 47) has a 1-in-2,118,760 chance, about 0.000047%. Now draw with duplicates allowed: the chance of rolling the same number twice in a row from 1–100 is exactly 1/100 = 1%, because each draw is independent. That independence is why "hot" and "cold" numbers are an illusion — past draws never change the odds.

Related tools