Random number generator (seeded)

Generate random numbers from a seed: integers in a range, decimals, lottery-style draws without repeats and dice rolls, repeatable with xoshiro256**.

Drafted with AI writing toolsUpdated Checked examples: 6

Draw without replacement, like lottery numbers.
Same seed, same numbers. Change it for a new draw. A fresh unseeded draw from the browser's secure random source is not part of this calculation.
Try
Results
10, 13, 19, 87, 95, 37, 73, 40, 32, 34
Results: 10, 13, 19, 87, 95, 37, 73, 40, 32, 34
Sum
440
Mean
44
Smallest
10
Largest
95

These 10 results come from seed “2026”. The same seed and settings reproduce the same list. This supports checking a simulation, but does not prove that a draw was fair. Use these pseudorandom values for learning and simulation, not passwords, cryptographic keys or deciding prizes.

Each draw, in order

#1: 1010#1#2: 1313#2#3: 1919#3#4: 8787#4#5: 9595#5#6: 3737#6#7: 7373#7#8: 4040#8#9: 3232#9#10: 3434#10
How it's calculated S
  1. Seed

    The seed 2026 is used directly as the 64-bit starting value.

  2. Generator state

    SplitMix64, started from the seed, fills the four 64-bit words of xoshiro256**, which then produces one 64-bit output per step.

  3. Map each output to the range without bias

    m=100,x<⌊264m⌋m,k=1+(x mod m)m = 100,\quad x < \left\lfloor \frac{2^{64}}{m} \right\rfloor m,\quad k = 1 + (x \bmod m)

    Repeated values are allowed. Rejecting the top sliver of outputs avoids modulo bias. Results depend only on the seed; fresh entropy is not used in this calculation.

  4. Summary

    ∑=440,vˉ=44\sum = 440,\quad \bar v = 44

About the random number generator

In the formula a and b are the integer bounds, and only outputs x below the stated limit are accepted. Numbers come from xoshiro256**, a 64-bit pseudorandom generator by Blackman and Vigna with a period of 2²⁵⁶ − 1, whose starting state is filled from your seed by SplitMix64. Each 64-bit output x becomes min + (x mod m), where m is the number of possible values, after outputs from the top sliver of the 64-bit range are thrown away so that every value is exactly equally likely. Decimals are drawn as whole numbers of 10⁻ᵈ steps and divided back.

The default draws 10 integers from 1 to 100 with seed 2026: 10, 13, 19, 87, 95, 37, 73, 40, 32, 34. Anyone who enters the same seed and settings gets the same list, so raffle draws, classroom samples and simulations can be checked afterwards.

A seed-driven list is predictable to anyone who knows or guesses the seed. Reproducibility alone does not establish fairness: someone can try seeds until they like the result. Use this for learning and simulation, not passwords, encryption keys or deciding prizes.

How to pick a random number between two values

Count the possible values, m = b − a + 1, then turn each random 64-bit output x into a + (x mod m), discarding the rare outputs that would favor small numbers. For 1 to 100, m = 100, and ten draws with seed 2026 give 10, 13, 19, 87, 95, 37, 73, 40, 32, 34.

Both ends of the range are included, and every value in it is equally likely. A single draw from 1 to 10 with the same seed gives 10.

Same seed, same numbers

These are pseudorandom numbers: a fixed calculation turns a starting value, the seed, into a sequence that looks random. The same seed and settings give the same list on any device, so a classroom sample or a simulation can be checked later.

Change the seed for a new draw. Reloading the page with the same seed repeats the same list.

A whole-number seed from 0 to 18,446,744,073,709,551,615 (2⁶⁴ − 1) is used directly. Any other text is hashed with 64-bit FNV-1a, documented in RFC 9923, after spaces at either end are removed.

So " 2026 " gives the same list as 2026, while Hello and hello give different lists. To share a reproducible draw, give the seed together with the range, count and options.

Why a plain remainder is biased

Taking x mod m alone favors some values whenever m doesn't divide the number of possible outputs. Map a byte, 0 to 255, onto 1 to 100 that way and 1–56 each get a 3/256 chance (1.17%), while 57–100 get only 2/256 (0.78%).

The fix is rejection: discard any output at or above ⌊2⁶⁴ ÷ m⌋ × m and draw again. For m = 100 that throws away just 16 of the 2⁶⁴ possible outputs, and every value becomes exactly equally likely.

Drawing without repeats

Lottery-style draws sample without replacement: a value that has already come up is redrawn until the count is reached. Six numbers from 1 to 49 with seed 2026, sorted, are 11, 12, 18, 37, 40, 45.

Each of the C(49, 6) = 13,983,816 possible sets is equally likely, including 1, 2, 3, 4, 5, 6. Sorting changes only the order of the list, never its values or sum.

Asking for every value in a range shuffles it: all five of 1–5 without repeats come out as 5, 3, 4, 2, 1. A range can't supply more unique values than it holds, so six unique numbers from 1–5 is impossible.

Example draws and their sums

Every row uses seed 2026 except 3d6, which uses hello. Rows are whole numbers unless decimal places are given, and repeats are allowed unless stated. The lists were checked against the generator authors' published C routines.

SettingsResults, in orderSum
1–100; 10 draws10, 13, 19, 87, 95, 37, 73, 40, 32, 34440
1–10; 1 draw1010
1–49; 6 draws; no repeats; sorted11, 12, 18, 37, 40, 45163
1–5; 5 draws; no repeats5, 3, 4, 2, 115
1–5; 5 draws; no repeats; sorted1, 2, 3, 4, 515
0–1; 5 draws; 3 places0.683, 0.143, 0.793, 0.253, 0.3752.247
-0.025–0.025; 5 draws; 2 places0.02, 0.00, 0.01, -0.01, 0.020.04
-0.025–0.025; 5 draws; 2 places; no repeats; sorted-0.02, -0.01, 0.00, 0.01, 0.020.00
0.101–0.119; 3 draws; 2 places0.11, 0.11, 0.110.33
0–0.000000000005; 6 draws; 12 places; no repeats; sorted0.000000000000, 0.000000000001, 0.000000000002, 0.000000000003, 0.000000000004, 0.0000000000051.5E-11
3d6; seed hello1, 6, 18
2d2010, 1323
7–7; 3 draws7, 7, 721

Random decimals

Decimals come from a grid. At d decimal places, the possible values are the multiples of 10⁻ᵈ that lie inside the bounds, so at 2 places −0.025 to 0.025 allows only −0.02, −0.01, 0.00, 0.01 and 0.02.

From 0.101 to 0.119 at 2 places, 0.11 is the only grid point, which is why that row repeats it. From 0.101 to 0.109 there is none at all; add decimal places or widen the range.

Every grid point is equally likely, so the draws follow a uniform distribution, not a bell curve. Trailing zeros show the chosen precision: 0.00 at 2 places is a drawn value, not a blank.

Dice rolls

Each die gives a whole number from 1 to its number of sides. Two twenty-sided dice (2d20) with seed 2026 roll 10 and 13, a total of 23. Three six-sided dice with seed hello roll 1, 6 and 1, a total of 8.

For the theoretical chance of a total, such as 7 with two dice, use the dice, coin and card probability calculator.

Is it random enough?

The generator is xoshiro256**, with its starting state filled from the seed by SplitMix64. Its period is 2²⁵⁶ − 1, and its authors publish the algorithm and reference C code. That suits games, sampling and simulation.

It is not for secrets. Anyone who knows or guesses the seed can rebuild the list, so passwords and encryption keys need a cryptographically secure source, such as a password manager or the browser's crypto.getRandomValues.

Reproducibility also doesn't prove a draw was fair, because someone could try seeds until a result they like appears. Don't use a seeded list to decide prizes.

Range and count limits

  • 1 to 1,000 numbers, or 1 to 1,000 dice with 2 to 1,000 sides each.
  • 1 to 12 decimal places, and at most 2⁶³ possible values in one range.
  • Whole-number bounds for integers, with the lower bound no greater than the upper.

Worked examples

Ten integers 1–100, seed 2026 (defaults)

Generate
Integers
From
1
To
100
How many
10
Seed
2026
Results
10, 13, 19, 87, 95, 37, 73, 40, 32, 34
Sum
440
Smallest
10
Largest
95

Checked against: Independent calculation

Lottery: 6 of 49, no repeats, sorted

Generate
Integers
From
1
To
49
How many
6
No repeats
yes
Sort the results
yes
Seed
2026
Results
11, 12, 18, 37, 40, 45
Sum
163

Checked against: Independent calculation

Five decimals in [0, 1] to 3 places

Generate
Decimals
From
0
To
1
How many
5
Decimal places
3
Seed
2026
Results
0.683, 0.143, 0.793, 0.253, 0.375
Sum
2.247

Checked against: Independent calculation

3d6 with a text seed

Generate
Dice rolls
Number of dice
3
Sides per die
6
Seed
hello
Results
1, 6, 1
Sum
8

Checked against: reference; the text seed hashes to FNV-1a 64 0xa430d84680aabd0b, the published FNV-1a hash of “hello”

Questions

Are these random numbers truly random?

No, they are pseudorandom: a fixed calculation turns the seed into a sequence that looks random but repeats exactly for the same seed. That suits games, sampling and simulation. Passwords and keys need a cryptographically secure generator, such as the browser's crypto.getRandomValues or a deterministic random bit generator specified in NIST SP 800-90A, which an observer cannot predict from past outputs.

What does the seed do?

The seed sets the generator's starting state, so the same seed and settings always give the same numbers on any device. A whole-number seed from 0 to 18,446,744,073,709,551,615 (2⁶⁴ − 1) is used directly; any other text is hashed with 64-bit FNV-1a. For example, 3 six-sided dice with the seed hello always roll 1, 6, 1.

How do I draw lottery numbers without repeats?

Set the range to 1–49, How many to 6 and turn on No repeats; a duplicate is redrawn until 6 different numbers remain. Each of the C(49, 6) = 13,983,816 possible sets is equally likely, including 1, 2, 3, 4, 5, 6. Turn on Sort the results to list them in order, as lottery tickets do.

Why not just take the generator's output modulo the range?

Because the plain remainder favours some values whenever the range doesn't divide the number of possible outputs. A toy generator with 8 outputs (0–7) mapped to 3 values by x mod 3 gives remainders 0, 1, 2, 0, 1, 2, 0, 1, so two values get 3/8 and one gets 2/8. Rejecting outputs 6 and 7 makes each value exactly 1/3; this calculator applies the same rule to its 2⁶⁴ outputs.

About this calculator

v=a+(x mod m),m=b−a+1x<⌊264/m⌋m\begin{gathered} v = a + (x \bmod m),\quad m = b - a + 1 \\ x < \left\lfloor 2^{64}/m \right\rfloor m \end{gathered}

Sources

  1. Blackman & Vigna, Scrambled linear pseudorandom number generators (xoshiro256**), ACM TOMS 47(4), 2021
  2. Steele, Lea & Flood, Fast splittable pseudorandom number generators (SplitMix64), OOPSLA 2014
  3. Fowler–Noll–Vo hash, FNV-1a 64-bit parameters (IETF draft-eastlake-fnv)

Checked against references

This calculator includes 6 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.