Skip to content
MyCalc
Math

Random Number Generator

Generate random numbers within a custom range, with or without duplicates, any quantity.

  • Free forever
  • Instant results
  • Private — runs in your browser

How to use the Random Number

Set your minimum and maximum (both included), how many numbers you want, and how many decimal places. Tick “No duplicates” to draw without replacement — like pulling numbered balls from a bag. Click Generate.

Formula

Numbers come from the browser's cryptographically secure generator (crypto.getRandomValues). Rejection sampling keeps every value in the range equally likely, and unique results use a Fisher–Yates shuffle (sampling without replacement).

Frequently asked questions

Is this truly random?

It uses the browser’s cryptographically secure random number generator, which is suitable for games, raffles and sampling. For regulated lotteries, use a certified hardware random source.

Why do I get an error when asking for many unique numbers?

Without duplicates you cannot draw more numbers than exist in the range. For example, 1 to 10 contains only 10 whole numbers.

Random Number guide

When to Use Random Numbers

Random numbers are used in lotteries, raffle drawings, scientific sampling, statistical simulations (Monte Carlo methods), cryptography, gaming, and A/B testing. This generator lets you specify a range, quantity, and whether duplicates are allowed, making it suitable for most common random selection needs.

History & interesting facts

Did you know?

Computer-generated random numbers are technically "pseudorandom" — they are determined by an initial value called a seed. True random numbers require physical processes like atmospheric noise, radioactive decay, or quantum measurements.

Origin & history

True randomness is surprisingly difficult to achieve. Early random number generators used physical processes like dice rolling or shuffled cards. The first computer-based pseudorandom number generator was developed by John von Neumann in 1946 using the "middle-square method." Modern computers use algorithms like the Mersenne Twister (1997), which has a period of 2^19937-1.

Fascinating facts

  1. 1

    RANDOM.ORG generates true random numbers using atmospheric noise and is used for official lotteries and scientific research.

  2. 2

    The probability of any specific number appearing in a fair random selection is exactly 1/N, where N is the range size.

  3. 3

    Cryptographic applications require cryptographically secure pseudorandom number generators (CSPRNGs) that are unpredictable even if previous outputs are known.

  4. 4

    Humans are poor at generating random sequences — we tend to avoid repeating numbers and alternate too much, creating patterns.

More math calculators