This random number generator picks a number between any two limits you set, instantly. By default it draws from your browser’s cryptographic generator with no modulo bias, so every number in the range has exactly the same chance. You can also generate lists with no repeats, decimals, normally distributed values, or a seeded list that you can reproduce later for an experiment or a class.
Random Number Generator
How to use the random number generator
- Set the range. Type the lowest and highest value you want. Both limits are included, so 1 to 6 can return 1 and 6.
- Choose how many. One number, or up to 10,000 at once.
- Tick “No repeats” if every number must be different, such as a draw, a seating order or a random sample of roll numbers.
- Pick the type. Whole numbers, decimals (choose the decimal places), or a normal distribution with your own mean and standard deviation.
- Add a seed only if you need to repeat the result. The same seed always gives the same list, which is what you want for a simulation or an assignment that others must check.
- Press Generate, then Copy or Download CSV to paste the numbers into Excel, Google Sheets, MATLAB or Python.
The presets fill the form for the common jobs: rolling a die, choosing 1 to 100, a 6-from-49 draw with no repeats, a 4-digit PIN with leading zeros kept (0427 stays 0427), and shuffling 1 to 30 into a random order.
Random name picker: choose from a list
Need a random name, team or topic rather than a number? Paste the items below, one per line or separated by commas. The picker shuffles them with the same unbiased method and returns as many as you ask for, with no item picked twice. Set the count equal to the list length to get a full random order, for example for viva or presentation slots.
Random List Picker
How does a random number generator work?
A computer follows instructions exactly, so it cannot invent randomness out of nothing. There are two ways around this, and every generator you will meet is one of them or a mix of both.
| Type | Where the randomness comes from | Repeatable? | Typical use |
|---|---|---|---|
| Pseudo-random (PRNG) | A formula that turns a starting value (the seed) into a long sequence that looks random | Yes, same seed gives the same sequence | Simulations, games, Monte Carlo, machine-learning splits |
| True random (TRNG / hardware) | A physical process: electronic noise, clock jitter, radioactive decay, atmospheric noise | No | Seeding cryptographic generators, key generation hardware |
| Cryptographically secure (CSPRNG) | A PRNG with a secret, regularly refreshed seed taken from a hardware entropy source | No (the seed is hidden) | Passwords, OTPs, session tokens, encryption keys, fair draws |
This tool uses the third kind by default. Browsers expose it as crypto.getRandomValues(), which is fed by the operating system’s entropy pool. When you type a seed, it switches to a small, fast PRNG (SFC32) so that the list becomes reproducible.
A pseudo-random generator you can run by hand
The oldest widely used PRNG is the linear congruential generator (LCG):
Xn+1 = (a × Xn + c) mod m
Take a toy version with a = 5, c = 3, m = 16 and seed X0 = 7. The next value is (5 × 7 + 3) mod 16 = 38 mod 16 = 6. Continuing gives:
7, 6, 1, 8, 11, 10, 5, 12, 15, 14, 9, 0, 3, 2, 13, 4, then 7 again
Every value from 0 to 15 appears exactly once before the sequence repeats, so the period is the full 16. That happens because the constants meet the Hull-Dobell conditions (c and m share no factor, and a − 1 is divisible by every prime factor of m and by 4 when m is). Real LCGs use m = 232 or 264, but the weakness is visible even here: once you have seen one output and know the constants, you can predict all the rest. That is why an LCG is fine for a game and never acceptable for a password.
Generators used by common languages
| Where | Default generator | Safe for secrets? | Secure alternative |
|---|---|---|---|
Python random | Mersenne Twister (MT19937), period 219937 − 1 | No | secrets.randbelow(n) |
JavaScript Math.random() | xorshift128+ in Chrome/V8 | No | crypto.getRandomValues() |
C++ <random> | You choose, commonly std::mt19937 | No | OS source such as /dev/urandom or getrandom() |
Java java.util.Random | 48-bit LCG | No | java.security.SecureRandom |
Excel RAND, RANDBETWEEN | Mersenne Twister since Excel 2010 | No | Not built in |
Mersenne Twister passes most statistical tests, but after observing 624 consecutive 32-bit outputs an attacker can rebuild its internal state and predict every later number. Statistical quality and unpredictability are different properties.
Modulo bias: why many random number tools are slightly unfair
The most common mistake in random number code is squeezing a random value into a range with the remainder operator. Suppose a program takes a random byte (0 to 255) and computes byte % 100 + 1 to get 1 to 100.
256 does not divide evenly by 100: 256 = 2 × 100 + 56. The remainders 0 to 55 can each be reached three ways (for example 5, 105 and 205), while 56 to 99 can only be reached two ways. So:
- Numbers 1 to 56 each come up with probability 3/256 = 1.17%
- Numbers 57 to 100 each come up with probability 2/256 = 0.78%
The low numbers are 1.5 times more likely than the high ones. In a lucky draw that is plainly unfair, and in cryptography a bias like this has been enough to recover secret keys. The fix is rejection sampling: throw away raw values at or above the largest multiple of the range (here 200) and draw again. This generator does exactly that, using 53-bit raw values, so every number in your range has an identical probability.
Is the generator fair? Test it yourself
You can check any random number generator with the chi-square goodness-of-fit test. Roll a virtual die many times, count each face, and compare with the count you would expect.
χ² = Σ (O − E)² / E
Worked example: 600 rolls give faces 1 to 6 counts of 95, 104, 98, 110, 91 and 102. The expected count is 600 / 6 = 100 for each face.
χ² = (25 + 16 + 4 + 100 + 81 + 4) / 100 = 2.30
With 6 faces there are 5 degrees of freedom, and the 5% critical value is 11.07. Since 2.30 is well below 11.07, there is no evidence of bias. The button below runs the same test on 60,000 rolls from the generator on this page.
Fairness Test (60,000 dice rolls)
A fair generator should still fail about 1 run in 20 at the 5% level; that is what “5% significance” means. If a generator fails most runs, it is biased. Serious testing uses batteries of tests such as NIST SP 800-22, TestU01 (BigCrush) and PractRand, which look for patterns a single chi-square test would miss.
Why do random lists contain repeats?
Repeats are normal and are evidence of randomness, not a fault. If you draw 10 numbers from 1 to 100 with repeats allowed, the chance of at least one duplicate is about 37% (1 − 100 × 99 × … × 91 / 10010). This is the birthday problem: in a group of just 23 people, the chance that two share a birthday is 50.7%. If your task needs distinct values, tick “No repeats” rather than regenerating until the list looks tidy.
When should you use a seed?
Use a seed when someone else must be able to reproduce your numbers. Typical engineering cases:
- Monte Carlo simulation in a lab report, so the examiner gets the same result you did.
- Train/test splits in a machine-learning project (
random_state=42in scikit-learn is exactly this). - Random sampling for quality checks, such as choosing which 20 of 500 cubes or bolts to test, where the sample must be auditable later.
- Debugging: a bug that appears only with some random inputs can be replayed with the same seed.
Never use a seed for anything secret. A seeded list is only as unpredictable as the seed, and “1234” or “test” can be guessed in seconds.
Generate random numbers in Excel, Python and other tools
| Tool | One whole number from 1 to 100 | 10 numbers, no repeats |
|---|---|---|
| Excel / Google Sheets | =RANDBETWEEN(1,100) | =TAKE(SORTBY(SEQUENCE(100),RANDARRAY(100)),10) (Excel 365) |
| Python | random.randint(1, 100) | random.sample(range(1, 101), 10) |
| Python (secure) | secrets.randbelow(100) + 1 | secrets.SystemRandom().sample(range(1, 101), 10) |
| NumPy | rng = np.random.default_rng(42); rng.integers(1, 101) | rng.choice(np.arange(1, 101), 10, replace=False) |
| C++ | std::uniform_int_distribution<int> d(1,100); d(gen) | std::shuffle on 1..100, take the first 10 |
| MATLAB | randi([1 100]) | randperm(100, 10) |
Note that RANDBETWEEN and RAND recalculate every time the sheet changes. Copy the cells and use Paste Special > Values to freeze them.
Normal distribution: when uniform numbers are the wrong choice
Uniform numbers suit draws and dice. Real measurements rarely behave that way: the diameter of machined shafts, cube strength of concrete, or the marks in a large class cluster around an average. Choose Normal in the generator, enter the mean and standard deviation, and it produces values where about 68% fall within ±1σ, 95% within ±2σ and 99.7% within ±3σ. It uses the Box-Muller transform: two uniform numbers u1, u2 become z = √(−2 ln u1) × cos(2πu2), which is then scaled to μ + σz.
Example: to simulate 50 concrete cube results for M25 with a standard deviation of 4 N/mm², the target mean strength is 25 + 1.65 × 4 = 31.6 N/mm². Enter mean 31.6, SD 4, 50 numbers, 1 decimal place.
Random numbers and security
For passwords, OTPs, API keys and encryption keys, only a cryptographically secure generator is acceptable. In the United States, NIST SP 800-90A, 800-90B and 800-90C (the last finalised in September 2025) specify how approved generators and their entropy sources must be built. The public NIST Randomness Beacon publishes a fresh 512-bit random value every minute, but because everyone can see it, it is meant for public, verifiable draws and never for secrets. For how NIST fits into engineering and security work more broadly, see our guide to NIST standards and frameworks.
Frequently asked questions
Is this random number generator truly random?
With the seed box empty, it uses your browser’s cryptographically secure generator, which is continuously seeded from hardware noise collected by the operating system. For practical purposes the output is unpredictable. With a seed, the output is pseudo-random and repeatable by design.
How do I generate random numbers without repeats?
Tick “No repeats” before you press Generate. The tool refuses impossible requests, such as 20 unique numbers between 1 and 10, instead of silently repeating values.
Can I get the same random numbers again?
Yes. Type any word or number in the Seed box. The same seed with the same settings always returns the same list, on any device.
Can a random number generator be predicted?
Simple generators such as LCGs and Mersenne Twister can be predicted once enough outputs are seen. Cryptographically secure generators are designed so that knowing past outputs gives no useful information about the next one.
What is the best random number generator for a lucky draw?
Use a cryptographically secure source with no modulo bias and record how the draw was done. For a draw that people will dispute, announce the method and range in advance, and for full public verifiability, derive the result from a public beacon value published after entries close.
More free tools: unit converter · percentage calculator · decimal to binary and hex converter · probability notes · all engineering calculators