Random integer generator

Random integer generator: use minimum integer, maximum integer, how many integers. Review the formula, worked example and calculation steps.

Inputs

Use the units shown
RESULT
—

Enter your values and select Calculate.

Formula & explanation
Accept w < floor(2³²/span)×span; draw = min + w mod span

Variables & units

Minimum integer
Numeric value · minimum -1000000000, maximum 1000000000
Maximum integer
Numeric value · minimum -1000000000, maximum 1000000000
How many integers
Numeric value · minimum 1, maximum 100

Worked example

Minimum 1 and maximum 6 generates a whole number from 1 to 6, inclusive.

Assumptions

Independent draws with replacement using platform cryptographic randomness. No weighted probabilities or sampling without replacement. A saved draw reopens with the original entropy; reset inputs to generate fresh draws.

Formula version 1.0.0. JavaScript floating-point arithmetic applies. Results display up to 6 decimal places; stored values retain available precision. Use the units shown.

Calculated on your device. Your latest 100 calculations stay in this browser.