Skip to content
Mathico

Random Number Generator

Generate fair random numbers in any range, such as 1–100, 1–16, a 4-digit number or your own limits. Pick one or many, with or without repeats.

Quick ranges
Numbers
Repeats
Sort

Your random number

Press Generate

How to use the random number generator

  1. Choose a range: tap a quick range (1–10, 1–16, 1–100, 1–1000, 4-digit, dice) or type any minimum and maximum, including negatives.
  2. Choose how many numbers you want (up to 1,000), whole or decimal.
  3. Set repeats and sorting: "No repeats" works like drawing tickets from a hat, and sorting makes long lists easier to read.
  4. Press Generate. Copy the result with one tap; your previous draws stay listed until you leave the page.

How the numbers are generated

Many simple generators use a basic pseudo-random function and the remainder (modulo) trick to fit numbers into a range. That can make some numbers slightly more likely than others. This generator does two things differently:

  • Secure source: it draws from your browser's cryptographically secure generator (crypto.getRandomValues), the same randomness used to create encryption keys.
  • No modulo bias: values that would tilt the odds are thrown away and redrawn (rejection sampling), so every number in your range has exactly the same chance.
P(any one number) = 1 ÷ (max − min + 1)
1–100 → 1 ÷ 100 = 1% per draw · 1–16 → 6.25% · dice 1–6 → 16.67%

With "No repeats" on, numbers are drawn using a Fisher–Yates shuffle, so every possible set of picks is equally likely.

Popular uses

  • Giveaways and raffles: number the entries, set the range to match, turn on No repeats, and draw your winners.
  • Classrooms and games: pick a student, a question number, a team order or a board-game move. 1–16 is popular for tournament seeding and bracket slots.
  • Decisions: assign each option a number and let the generator choose. For yes/no, use 1–2.
  • Sampling and testing: select random rows from a list, random survey participants or test data.

Understanding the odds

RangeChance of a specific numberOdds against
1–6 (die)16.67%5 : 1
1–1010%9 : 1
1–166.25%15 : 1
1–1001%99 : 1
1000–9999 (4-digit)0.0111%8,999 : 1

"Odds against" is a ratio of losing outcomes to winning ones. Read more about ratios with the ratio calculator.

Streaks are normal. With repeats allowed, each draw is independent. Getting the same number twice in a row from 1–10 happens 10% of the time; it doesn't mean the generator is broken. The idea that a number is "due" is the gambler's fallacy.

Good to know

  • Numbers are generated on your device and aren't stored or sent anywhere.
  • For passwords, use a password manager that generates and stores them securely.
  • Prize draws and lotteries may have legal requirements where you live. Check before running one.

Browse more math tools or see all calculators.

Related: find the odds of drawing specific cards, measure the spread of a set of numbers, or get normal distribution probabilities.

Frequently asked questions

Is this random number generator truly random?

It uses your browser's cryptographically secure random source (the Web Crypto API), the same kind of randomness used for encryption keys, and removes 'modulo bias' so every number in the range is equally likely. It's not a physical device such as radioactive decay, but it's unpredictable for any practical purpose.

How do I pick a random number between 1 and 100?

Set the minimum to 1 and the maximum to 100 (or tap the 1–100 preset) and press Generate. Each number has exactly a 1 in 100 chance on every draw.

How do I generate numbers without repeats?

Turn on 'No repeats'. Each number can then appear only once per draw, like drawing raffle tickets from a hat. You can't ask for more unique numbers than the range contains (for example, 11 unique numbers from 1–10).

Can I generate a random 4-digit number?

Yes. Tap the 4-digit preset (1000–9999) for numbers that always have four digits, or set 0–9999 if leading zeros are allowed, such as for a PIN. For real passwords or PINs, use a dedicated password manager.

Can I use this for a raffle or giveaway?

Yes. Number the entries, set the range to match, turn on 'No repeats' and draw the number of winners you need. For transparency, screen-record or share the draw. Check local rules for prize draws and lotteries.

Does the same number come up more often?

No. With repeats allowed, every draw is independent, so a number can appear twice in a row just by chance. Streaks are normal in random data and don't mean the generator is biased.