Random Number Generator

MATH FREE

Free random number generator. Pick random integers in any range, with unique or repeatable options. Instant, no signup.

Random integers in a range you set

A random number generator draws whole numbers between a minimum and a maximum, and you decide how many and whether repeats are allowed. The defaults produce five unique numbers from 1 to 100. It is built for draws, sampling, games, and classroom demos where you want many values at once rather than one at a time.

How the generator works

Repeats-allowed mode draws each value independently with the browser’s pseudo-random generator, scaling a number between 0 and 1 across the range and rounding down. Unique mode takes a different route: it builds a pool containing every integer from the minimum to the maximum, then runs a partial Fisher–Yates shuffle, swapping a random element into the next slot and taking it. Because each draw removes an element from the remaining pool, uniqueness is guaranteed rather than retried.

Two safeguards keep the inputs sensible. If the minimum is larger than the maximum, the two are swapped. If you ask for more unique numbers than the range can supply, the count is reduced to the size of the range so the request can be satisfied.

Worked example with the default settings

The defaults are range 1 to 100, five numbers, unique mode. The pool therefore starts as the 100 integers from 1 to 100. The shuffle takes position 100, swaps in a random element, and records it; then position 99, and so on, until five distinct values have been taken. Because the selected elements are moved out of play, no value can appear twice.

SettingDefaultEffect
Minimum1Smallest value allowed
Maximum100Largest value allowed
How many5Number of results
UniquenessUniqueNo repeats; pool of 100

Every number in the range has an equal chance of appearing, so five picks from 100 means each number has a 5 in 100 chance of being included.

Reference: chance of a repeat when repeats are allowed

The probability that at least one duplicate appears among k draws from n values is 1 − (n × (n−1) × … × (n−k+1)) ÷ n^k.

DrawsRangeChance of at least one repeat
21 to 6 (two dice matching)16.67%
31 to 644.44%
51 to 5018.64%
51 to 1009.65%

The same math explains why a repeat feels surprising but is not: with five picks from 100 the chance of a duplicate is close to one in ten, higher than most people expect.

Common mistakes

  • Asking for more unique numbers than exist. Wanting 10 unique values from 1 to 6 is impossible; the tool quietly caps the count at 6.
  • Treating the output as cryptographically secure. This uses the browser’s standard pseudo-random generator, which is fine for games and draws but not for passwords, keys, or anything with money at stake.
  • Reading a pattern into unique results. Unique only means no duplicates; two values can still land close together.
  • Expecting the same result twice. Every generation is independent, and the history panel records the previous sets for reference.

Is the output truly random?

No software generator is truly random without a hardware entropy source. This tool relies on the browser’s pseudo-random number generator, which is deterministic given the same internal state but is statistically well distributed for ordinary tasks. Security-sensitive work needs a cryptographically secure source instead.

Can I include zero or negative numbers?

Yes. The minimum and maximum accept any integer, so a range like −50 to 50 works, as does one that includes zero. The pool is built from every integer between the two bounds inclusive.

What happens if I want just one number?

Set the count to 1. The generator still runs the same code path, and in unique mode it takes a single element from the shuffled pool, giving a fair pick across the entire range.

How do I run a simple draw without repeats?

Use unique mode and set the range to match the number of entrants, then request as many winners as you need. Each value can only be drawn once, so there are no reruns and no accidental repeat winners.

Flipping a coin

A coin flip is just a random choice between two outcomes. Set the minimum to 0 and the maximum to 1, request one number, and treat 0 as heads and 1 as tails — or use a 1–2 range. For a run of flips, set the count and allow repeats so each toss is independent; unique mode instead gives you a shuffled set, which is a different thing.

The result is only as fair as the browser’s pseudo-random generator. For casual decisions, games, and classroom demonstrations that is fine. For anything with money or security at stake, use a cryptographically secure source rather than a web tool.

Set the range to 0–1 and a count of one to flip a coin, or summarise a batch of generated results with the standard deviation calculator.