Random Number Generator

Numbers generated—
Minimum—
Maximum—

How Random Number Generator is calculated: Each number = min + floor(random × (max − min + 1)). Default: 5 numbers between 1 and 100, each equally likely.

What is a random number generator?

A random number generator picks numbers at random from a range you choose. The default on this page makes 5 numbers between 1 and 100 — five picks, each equally likely to be any number in the range. Press the button and a new set appears. Press it again and a different set appears.

The need comes up everywhere chance has to be fair. A teacher picks a student at random. A raffle draws a winner. A game rolls dice. A developer tests code with random data. In each case, the numbers must be genuinely random — not picked by a person, because people are bad at random, and not predictable, because predictable is not fair.

This generator covers the choices people actually make: a minimum, a maximum, and how many numbers to generate, from 1 to 100 at a time. It shows the count, the minimum, and the maximum, so you can see the range you asked for. Everything runs in your browser — nothing is uploaded, nothing is stored, and there is no account to create.

How a random number generator works

The generator uses Math.random, the random function built into every browser. It returns a decimal between 0 and 1, and the generator scales it into your range with one formula: min + floor(random × (max − min + 1)). For the default range of 1 to 100, that is 1 + floor(random × 100), which gives every whole number from 1 to 100 an equal chance.

The +1 in the formula is the part people get wrong. Without it, the maximum could never appear: random × 99 gives 0 to 98, plus 1 gives 1 to 99, and 100 never comes up. With the +1, random × 100 gives 0 to 99, plus 1 gives 1 to 100, and every number in the range is equally likely. That is why the default output can include 1 and 100, not just the numbers between them.

Each number is picked independently, so repeats are possible and normal. Five numbers between 1 and 100 can include the same number twice — that is what random looks like. If you need five different numbers, generate more than five and drop the repeats. And if you swap the minimum and maximum by mistake, the generator swaps them back for you instead of failing.

Ranges, counts, and what random really looks like

The range sets the odds. One number between 1 and 100 has a 1-in-100 chance of being any particular value. One number between 1 and 6 is a die roll. One number between 1 and 2 is a coin flip. The smaller the range, the more often repeats show up — and that is correct, not a bug.

The count sets the sample. Five numbers between 1 and 100 tell you almost nothing about the distribution; a hundred numbers start to show it. If you generate 100 numbers between 1 and 10, each value should appear about ten times. If one value appears thirty times, something is wrong — but with only five numbers, any pattern is just chance. A password generator makes the same point for characters: randomness is the defence, and small samples look lumpy.

Random also means unpredictable. The numbers on this page come from the browser's random function, which is seeded from the system clock and other entropy sources. You cannot predict the next number from the last one, and neither can anyone else. That is what makes it fair for draws, games, and picks — and what makes it wrong for cryptography, where a stronger source is needed.

A worked example: picking a raffle winner

Here is a real situation where a random number generator earns its keep. Your class has 30 students, numbered 1 to 30, and you need to pick one at random to answer first. Pointing at someone is not random — you will pick the person you like, or the person nearest you. Generating is random.

Set the minimum to 1, the maximum to 30, and the count to 1. Press the button. The number that appears is the winner — every student had exactly a 1-in-30 chance, and no one can argue with the pick. If you need three winners, set the count to 3 and generate again; if a number repeats, generate one more to replace it.

Try the default as a second example. Five numbers between 1 and 100: the count shown is 5, the minimum is 1, and the maximum is 100. Each of the five numbers is equally likely to be any value in the range, including 1 and 100 themselves. And a smaller test — 3 numbers between 10 and 20 — shows a count of 3, a minimum of 10, and a maximum of 20. The range is always exactly what you asked for.

Who uses a random number generator, and why

Teachers are the biggest users. Picking a student, drawing a raffle winner, assigning groups, choosing a question number — all of it needs a fair pick, and a generator is fairer than a finger. A teacher who generates can show the class the number; a teacher who points cannot prove it was random.

Gamers and game masters are the second group. Dice rolls, loot drops, random encounters, and card draws all need random numbers, and a generator replaces a bag of dice. A lorem ipsum generator makes random text the same way this tool makes random numbers — from a fixed set, picked by chance.

Developers are the third group. Test data, sample values, random delays, and simulations all need random numbers, and a generator makes them on demand. The generator on this page handles all three uses — set a range, set a count, press the button, copy the result — which covers ninety percent of what anyone needs.

Event organisers are a fourth group, and they use the generator for lucky draws and seating plans. A draw done by hand invites arguments; a draw done by a generator is transparent — everyone sees the range, everyone sees the number, and no one can claim it was fixed. That transparency is the whole point of using a tool instead of a person.

Random number generator vs other generator tools

A random number generator makes numbers; other generator tools make text or secrets. The same tools family on this site does both jobs. A password generator makes random characters the same way this tool makes random numbers — the maths is identical, only the alphabet changes. A lorem ipsum generator makes random words from a fixed word bank. The text side of the same idea is a random word generator, which picks words from a built-in list for brainstorming, naming, and practice.

The difference matters for the job. Numbers are for picking, measuring, and testing. Passwords are for secrets. Filler text is for layouts. Use the right generator for the job, and the result will be the right shape.

Randomness is also the one idea all three tools share. A password is strong because its characters are random. A raffle is fair because its numbers are random. A layout test is honest because its filler is random. And a percentage calculator answers the next question people ask: what are the odds? A 1-in-100 pick is a 1 percent chance, and the calculator does that sum in seconds.

Common random number mistakes

The most common mistake is expecting random to look even. Five random numbers between 1 and 100 can include 7, 8, and 9 — three numbers in a row — and that is still random. Humans expect random to spread out; real random clusters. If your numbers look clumpy, that is evidence they are random, not evidence they are broken.

Second: using random numbers for security. The random function in a browser is fine for games, draws, and tests, but it is not strong enough for cryptography. Passwords, tokens, and keys need a cryptographic random source, not Math.random. Never generate a password with a plain random number tool. Randomness also identifies things: a random UUID generator makes unique identifiers for database rows, test records, and API keys.

Third: forgetting that repeats are possible. If you need five different numbers, generating five numbers is not enough — you might get a repeat. Generate more than you need, drop the repeats, and keep going until you have enough unique values.

Fourth: a range that is too small for the count. Asking for 100 different numbers between 1 and 10 is impossible — there are only ten values. If you need more unique numbers than the range holds, widen the range first.

How to use this random number generator

Using this random number generator is simple. Set the minimum — 1 is the default. Set the maximum — 100 is the default. Set how many numbers you want — 5 is the default, and you can ask for up to 100. Press Generate Numbers, and the numbers appear in the box below, with the count, minimum, and maximum shown above them.

To copy the result, use the Copy button next to the output box. To make another set, press the button again — every press makes a fresh set. If you need different numbers, change the range or the count and press again; the output updates with each press.

Everything runs in your browser. No sign-up, no account, no data sent anywhere — the numbers never leave your device, and they are never stored. It works offline once the page has loaded, so you can use it in a classroom, at a raffle, or anywhere else you need a fair pick. Try it with something real before you need it: pick a number between 1 and 30, or roll five numbers between 1 and 6. Once you have used it twice, you will never pick by pointing again.

Frequently Asked Questions

Set the minimum to 1, the maximum to 100, and the count to 1, then press Generate Numbers. Every number from 1 to 100 has an equal chance, including 1 and 100 themselves. The default on this page generates 5 numbers between 1 and 100 — change the count to 1 if you only need one.

They come from Math.random, the random function built into every browser, seeded from the system clock and other entropy sources. You cannot predict the next number from the last one. That is fair enough for draws, games, and tests — but not strong enough for cryptography, where a dedicated cryptographic source is needed.

Yes, and they should. Each number is picked independently, so five numbers between 1 and 100 can include the same value twice — that is what random looks like. If you need five different numbers, generate more than five and drop the repeats until you have enough unique values.

The generator swaps them back for you instead of failing. If you enter a minimum of 100 and a maximum of 1, it treats the range as 1 to 100. You always get numbers inside the range you meant, whichever box you typed them in.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.