Random Number Generator

Generate one or many random whole numbers in any range, with options for unique numbers and sorted results.

  • Reviewed October 2026
  • Formula and worked example below
  • Free, no sign-up, runs in your browser
Enter your numbers to see the result.

How the numbers are generated

This generator uses your browser's cryptographic random source (crypto.getRandomValues), the same one used to create encryption keys. It is far less predictable than the basic random functions in most programming languages, and every number in the range has an equal chance of being picked.

Common uses

  • Prize draws and giveaways: number your entries and draw winners with "No repeats" turned on.
  • Lottery-style picks: for 6 numbers from 1 to 49, set the range to 1–49, count to 6, and turn on no repeats and sorting.
  • Dice and games: 1–6 for a die, 1–20 for a D20.
  • Random sampling: choose survey participants or items to audit from a numbered list.
  • Teaching probability: generate 1,000 coin flips (range 0–1) and count how close you get to 50%.

Is it truly random?

Computer randomness comes from a cryptographically secure pseudo-random number generator seeded with unpredictable physical events, such as hardware timing noise. For all practical purposes, including fair draws, it is indistinguishable from true randomness. For regulated gambling or legal lotteries, certified hardware generators are required.

Odds of a draw

The chance of matching all 6 numbers picked from 49 is 1 in 13,983,816. In general, the number of possible combinations of k numbers from n is n! ÷ (k! × (n − k)!).

Frequently asked questions

Can I generate random numbers without repeats?

Yes. Tick "No repeats" and each number in the result will be different. The count must not exceed the number of values in your range.

Is this random number generator fair?

Yes. It uses the browser's cryptographically secure random source and maps values evenly across your range.

Can I pick a random winner from a list of names?

Number the names from 1 upward, set the range to match, and draw a number.

Add this calculator to your website

Free to use on blogs, school sites and company intranets. Copy this code into your page:

Last reviewed Oct 20, 2026. Results are estimates; check important decisions with a qualified professional.