Random Number Generator

  • Every possible random byte tested: each number in the range exactly equally likely
  • Checked by Wayne Bickerton
  • Sources: W3C, NIST
  • Updated November 6, 2026

A random number generator picks a number for you, fairly, when you can’t or shouldn’t choose: a raffle winner, a turn order, a number from 1 to 10. Enter the lowest and highest numbers, how many you want, and whether a number may come up twice.

Your number
42 1 – 100

A random whole number from 1 to 100: 42.

Possible numbers 100
Chance on one draw 1 in 100
Numbers drawn 1

How a random number generator works

Your browser has a built-in cryptographically strong random number generator, seeded with truly random values. This page takes random bits from it and turns them into a number in your range so that every number is exactly equally likely: it uses just enough bits to cover the range and draws again when they land past the end, instead of dividing and keeping the remainder (which would favour some numbers). Here it is with your numbers:

Number = lowest + a random whole number from 0 to (highest − lowest)

Here it is with your numbers:

  1. Possible numbers = 100 − 1 + 1
  2. Possible numbers = 100
  3. Random bits needed = 7 (whole numbers 0 to 127; 100 or more is drawn again)
  4. Your number = 1 + 41
  5. Your number = 42

It means every whole number from 1 to 100 had the same 1 in 100 chance.

With No repeats, a number that has already come up is drawn again, so each new number is equally likely among the ones left. It works for negative numbers and for ranges up to 9,007,199,254,740,992 numbers, the most a browser counts exactly.

Source W3C · Web Cryptography Level 2, the Crypto interface ↗

Is a random number generator truly random?

Computers follow instructions, so most generators are pseudorandom: a deterministic formula that stretches a short, truly random seed into a long sequence that looks random. What matters is whether anyone can predict it. A cryptographic generator, the kind used here, is built so that its output can’t be predicted without the secret seed.

Source NIST · Glossary, pseudorandom number generator ↗

Random number generator examples

To pickSettings
A number from 1 to 101 – 10, 1 number
A raffle winner from 250 tickets1 – 250, 1 number
3 winners from 30 entries1 – 30, 3 numbers, no repeats
A random order for 12 people1 – 12, 12 numbers, no repeats
6 lottery-style numbers1 – 49, 6 numbers, no repeats
A number from −10 to 10−10 – 10, 1 number

FAQs

Is any random number generator truly random?

Most, including this one, are pseudorandom: a formula that turns a truly random starting value (the seed) into a long run of numbers that look random. Your browser’s generator is seeded with truly random values from the device, and its output is built to be unpredictable.

Source W3C · Web Cryptography Level 2, the Crypto interface ↗

Is rand() actually random?

No. Functions like rand() in programming languages are pseudorandom number generators: deterministic algorithms that give the same numbers again from the same seed. That is fine for games and simulations, but not where someone could gain by predicting the next number.

Source NIST · Glossary, pseudorandom number generator ↗

Can random number generators be manipulated?

A simple generator can be predicted once someone knows its seed. A cryptographic generator, like the one this page uses, is built so its output is unpredictable as long as the seed is secret. The numbers here are drawn in your browser each time; we never see them.

Sources

Related calculators