Random Number Generator

Generate secure random numbers between any smallest and largest values — up to 100 at a time, all different or with repeats allowed. Handy for draws, games, and classroom picks.

Random Number Generator

How it works: Each number is picked with a cryptographically secure random source built into PHP, so every whole number in your range is equally likely. Submit again for a fresh set.

How the Random Number Generator Works

A random draw settles things fairly: picking a raffle winner, choosing who presents first in class, setting a draft order for a game, rolling dice when none are handy, or pulling a sample of entries from a long list. This generator produces whole numbers inside any range you set — a smallest and a largest value — as many at a time as you need, up to 100 per draw. You also choose whether every number in a set must be different (a true draw without replacement, like lottery balls) or whether repeats are allowed (like rolling dice, where the same value can come up twice).

Each number is picked with random_int, the cryptographically secure random function built into PHP. That is the same class of randomness used for security tokens and password resets, and it matters: every whole number in your range is equally likely to be chosen, and the next result cannot be predicted from the ones before it. Ordinary “random-looking” tricks — multiplying the current time, or continuing a pattern from a starting seed — can be guessed or repeated. A secure source cannot, which is what makes the draw fair even when something real depends on it.

The settings have sensible guard rails. If you enter the largest and smallest values the wrong way round, they are swapped automatically. The count is kept between 1 and 100 per draw. With “all different” switched on, the generator keeps drawing until it has your full set of distinct numbers — and if you ask for more different numbers than exist in the range (say, 10 different numbers between 1 and 5), it stops and tells you plainly that you asked for more different numbers than the range contains, so you can widen the range or allow duplicates. Every press of the button produces a completely fresh set; nothing is remembered between draws.

How to Use This Calculator

  1. Enter the smallest value you want in the range.
  2. Enter the largest value you want in the range.
  3. Enter how many numbers to generate — anywhere from 1 to 100.
  4. Choose whether all numbers must be different, or whether repeats are allowed.
  5. Press the button to generate your set, and press again whenever you want a fresh one.

Example

Example 1 (illustrative). For a small raffle, set the range from 1 to 49, ask for 6 numbers, and switch on “all different”. One possible result is 4, 11, 19, 27, 33, 48. Because the draws are genuinely random, this exact set is only an illustration — your draw will come out differently every time, and no set of six is any more or less likely than another.

Example 2 (illustrative). To roll two dice without dice, set the range from 1 to 6, ask for 2 numbers, and allow repeats. A sample result is 3 and 5, totalling 8. Allowing repeats is the important setting here: with “all different” switched on, a double — two 6s, say, which is a classic dice roll — could never appear.

Understanding Your Result

The order of the numbers carries no meaning: they are simply listed as drawn, not sorted or ranked. Short runs of random numbers often look suspiciously patterned — the same value twice in a row, a little cluster, no “spread” — but that clumpiness is exactly what real randomness looks like. A perfectly even spread every time would be the sign of something artificial. Each number is drawn independently, so a value that has just appeared is neither “hot” nor “due to rest”; its chance on the next draw is exactly the same as every other number in the range. If repeats are allowed and one shows up twice, the generator is not stuck — it is doing its job. One practical warning: a fresh draw replaces the old one completely, and there is no history to go back to. If the set matters — the winning raffle numbers, the running order for a contest — write it down, screenshot it or read it aloud to a witness before you press the button again, because the moment you generate a new set, the previous one is gone for good.

Random Number Generator FAQs

Are the numbers really random, and can anyone predict them?

They are drawn with PHP’s cryptographically secure random_int source, designed so results cannot be predicted from previous draws or worked out from a pattern. For games, draws and sampling, that is genuine unpredictability.

Why did the generator refuse my settings?

You asked for more different numbers than exist in your range. A range of 1 to 5 holds only five different numbers, so it cannot supply ten unique ones — widen the range or allow duplicates.

Can I generate decimal or negative numbers?

The range bounds simply need to be whole numbers for the limits; the smallest value can be negative, so a range from −10 to 10 works fine. Results are always whole numbers, though — this tool does not produce decimals.

How many numbers can I generate at once?

Up to 100 in a single draw. If you need more, note the first set down and generate again — each new draw is fresh and independent.

Can I use this for a prize draw or giveaway?

For friendly, community and classroom draws it is ideal, especially with the settings visible to everyone taking part. Formal or regulated promotions may require certified drawing systems and audited procedures, so check the rules that apply to your draw first.

Related calculators: Password Generator, Percentage Calculator, Scientific Calculator.