Skip to calculator
Libre CalculatorThe universe in numbers

Random number picker

Pick a whole number between two limits. The same seed always gives the same pick, so a draw can be repeated and checked.

Answer

95

Steps

Seed 42 → 705,894; 1 + (705,894 mod (100 − 1 + 1)) = 95. Use 705,894 as the next seed for another pick.

Where the pick lands in your range
100 whole numbers from 1 to 100 could be picked. Change the seed for another pick.
The pick 95 lies in the range 1 to 100, which holds 100 whole numbers.

Watch the explainer

196 seconds · 8 chapters · captions included

0:00 / 3:16The sealed envelope

Explanation

A repeatable random pick

A seeded picker makes the same choice whenever its seed and range are the same. This is useful for reproducible examples, casual games and repeatable demonstrations. Change the seed to make another deterministic choice.

Range and seed

Enter the smallest and largest whole numbers you allow (both included) and a seed from 1 to 2,147,483,646. The same range and seed always give the same pick, so a result can be checked or shared. For a new pick, change the seed or enter the next seed shown in the steps. The calculator never reads the clock or system randomness.

s′ = (16807 × s) mod 2147483647; r = a + (s′ mod (b − a + 1))

Variables
rpicked number
sseed
s′next seed
asmallest allowed number
blargest allowed number

Seed 1 on a 1–6 range

From1
To6
Seed1
Result2

Seed 1 → 16,807; 1 + (16,807 mod (6 − 1 + 1)) = 2. Use 16,807 as the next seed for another pick.

A 10–10 range with 1 number

From10
To10
Seed5
Result10

Seed 5 → 84,035; 10 + (84,035 mod (10 − 10 + 1)) = 10. Use 84,035 as the next seed for another pick.

Seed 2 on a 0–9 range

From0
To9
Seed2
Result4

Seed 2 → 33,614; 0 + (33,614 mod (9 − 0 + 1)) = 4. Use 33,614 as the next seed for another pick.

Diagram of this result

The range from the smallest to the largest allowed number, with the pick marked.

A number line runs from the smallest to the largest allowed whole number and a marker shows the pick. The exact numbers are stated in the answer and the steps.

Common mistakes

Reusing a seed deliberately repeats a result. The maximum endpoint is included. This simple generator is predictable and has small modulo bias; do not use it for security, lotteries, statistical sampling or decisions requiring verified fairness.

Assumptions and limits

Uses Park–Miller recurrence next = seed × 16807 mod 2147483647, then minimum + (next mod range size). It is a pedagogical pseudorandom mapping, not true randomness or cryptographic entropy. Results stay in the requested inclusive interval. Numeric observations use up to 30 significant input digits and 50 internal digits; no presentation rounding enters the calculation.

Sources

Park and Miller, Random Number Generators: Good Ones Are Hard to Find, Communications of the ACM 31 (1988). Recurrence and all example modular products are explicitly documented here.

Why does clicking again give the same number?

The calculator is reproducible by design. Enter the displayed next seed, or choose another seed, to advance the deterministic sequence.