Skip to main content
Calcimator

Random Number (seeded)

Deterministic pseudo-random integers from a seed (reproducible).

About this calculator

Despite the name, this is not a source of genuine randomness — it's a fully deterministic linear congruential generator (LCG), the same class of algorithm C's rand() historically used, seeded and stepped by `seed = (1664525 * seed + 1013904223) >>> 0` (line 18). Given the same Seed, Min, and Max every time, it produces the exact same three draws and Next Seed State every time — that determinism is why this calculator, unlike a truly nondeterministic random-number source, can carry mechanically-verified factual claims about its own behavior at all. It also swaps out-of-order bounds rather than erroring: `Math.min(lo, hi)` and `Math.max(lo, hi)` (lines 15-16) mean typing Min=100 and Max=1 quietly produces draws between 1 and 100, not an error or an empty range.

One coincidence worth knowing before reading too much into what changing the seed appears to do: at Seed=42, Min=1, Max=100, a seed of 37 and a seed of 46 both happen to produce 26 as the very first draw — purely by chance, since the LCG maps two different seeds into the same 1-to-100 bucket on that particular draw — while the second and third draws from those same two seeds diverge sharply (64 vs 46, 16 vs 32). What this does not account for: any statistical test of the LCG's own randomness quality (period length, correlation between successive draws) — it is fast and reproducible, not cryptographically or even statistically strong.

Inputs

Results

Draw 1

26

Draw 29
Draw 358
Next seed state2,479,403,867
How to Use This Calculator
  1. Enter a seed value to initialize the pseudo-random number generator.
  2. Set the minimum and maximum bounds for the output range (inclusive).
  3. View three deterministic random draws and the next seed state.
  4. Using the same seed always produces the same sequence, making results reproducible.

Recommended for this calculation

We may earn a commission if you sign up through these links.

Texas Instruments

Graph, solve, and visualize every statistics problem

TI-84 Plus CE Graphing Calculator, Color Screen

See on Amazon
Mr. Pen

Work through problems the way they're meant to be graphed

Mr. Pen Graph Grid Journal Notebook, A5, 160 Pages

See on Amazon
Casio

417 functions for every equation you'll ever face

Casio fx-991ES Plus 2 Scientific Calculator

See on Amazon

Texas Instruments: As an Amazon Associate I earn from qualifying purchases.

Mr. Pen: As an Amazon Associate I earn from qualifying purchases.

Casio: As an Amazon Associate I earn from qualifying purchases.

How the result changes with Max (inclusive)

Max (inclusive)Draw 1
-800,000,000-598,123,860
-300,000,000-224,296,448
300,000,00075,703,553
800,000,000201,876,140

What each input means

Seed
Change seed for different sequence.
Min (inclusive)
Lower bound.
Max (inclusive)
Upper bound.

How this is calculated

Formula

LCG: seed = (1664525 × seed + 1013904223) mod 2³² | result = min + floor(random × (max − min + 1))

Engine last updated . Checked against 3 independently-derived tests how we verify calculators.

Frequently Asked Questions

Is this calculator actually using JavaScript's built-in random-number function?

No — it's a seeded linear congruential generator, a fully deterministic algorithm (line 18) that produces the identical sequence of draws every time you supply the same Seed, Min, and Max. That's a deliberate design choice for reproducibility: two people using the same seed and range get exactly the same three numbers, which a truly nondeterministic source could never guarantee.

What happens if I set Min higher than Max, like Min=100 and Max=1?

The calculator does not error or return an empty range. It computes `a = Math.min(lo, hi)` and `b = Math.max(lo, hi)` (lines 15-16) before generating any draws, so it silently reorders the two bounds and produces numbers between 1 and 100 regardless of which field you called "Min" and which you called "Max."

Why did Draw 1 come out identical for two noticeably different seed values?

It's a coincidence specific to that particular pair of seeds and this particular range, not evidence that Seed doesn't matter. A seed of 37 and a seed of 46 both happen to land on 26 as their first draw within a 1-to-100 range — but their second and third draws diverge immediately (64 vs 46, then 16 vs 32), confirming the seed drives every draw; the first one just landed on the same bucket by chance.

Does the Min or Max bound affect Next Seed State?

No — Next Seed State is purely the internal LCG value after three update steps (line 18 run three times), and that recurrence never references Min or Max at all; only Seed itself determines where the sequence starts and where Next Seed State ends up.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.