How does a world seed make the same world every time?

Computers can't flip coins, so games make random-looking numbers with a formula. Multiply the last number by a big number, add another, and keep only the remainder after dividing. Start from the seed and every number after it is fixed, so the hills, caves, and trees come out exactly the same every time.

random numbers: 12,524, 52,341, 58,098, 13,427, 42,568, …each one = (25,173 × the last one + 13,849) mod 65,5364 trees · tallest 10 blocks
First random number
12,524
Tallest column (blocks)
10
Trees
4

Real games use bigger, better generators and smooth “noise” functions for terrain, but the idea is the same: every block follows from the seed.

Challenge: Find a seed that grows 8 or more trees.

Type any whole number from 0 to 65,535.
Each pass averages every column with its neighbors.

Play

Press "Run it: generate the world," then change the seed by just 1 and generate again.

Challenge: Find a seed that grows 8 or more trees. The box under the picture turns green when you get it.

Stuck? Pick one of the examples from the “Try an example” menu, or press “New example.”

Understand

xn+1=(25173 xn+13849) mod 65536x_{n+1} = (25173\,x_n + 13849) \bmod 65536

A computer can't flip a coin, so a game makes pseudo-random numbers with a formula. Start from the seed, multiply, add, and keep the remainder:

xn+1=(25173 xn+13849) mod 65536x_{n+1} = (25173\,x_n + 13849) \bmod 65536

"Mod" is the remainder after dividing, the same idea as a clock wrapping around. Each number becomes the height of one column of blocks. Smoothing averages each column with its neighbors to turn spikes into hills, and a second run of numbers decides where trees grow. Press "Run it" to watch the world build column by column.

Use

Every input has a unit menu, so you can type values in the units you already have. Results follow your units.

Show the work

  1. Multiply the seed, add a number, and keep only the remainder after dividing by 65,536x_1 = (25173 \times 41095 + 13849) \bmod 65536 = 12524
  2. Do it again to the answer for the next number, and again, and againx_2 = (25173 \times 12524 + 13849) \bmod 65536 = 52341
  3. Turn each number into a column height from 3 to 10 blocks3 + \left\lfloor \frac{12524}{65536} \times 8 \right\rfloor = 4\ \text{blocks}
  4. The same seed gives the same numbers, so the same world\text{seed } 41095 \to 12524, 52341, \ldots\ \text{every time}

Export

Export PDF

Pick a seed and how smooth the hills are. Then change the seed by 1 to see how different the next world is.

  • This is a small, classic generator. Real games use longer formulas, but the seed works the same way.

For learning and estimation. Verify with applicable codes, standards, and a qualified professional before using in design, construction, or safety-critical work.

Cheat card

xn+1=(a xn+c) mod mx_{n+1} = (a\,x_n + c) \bmod m
a=25173, c=13849, m=65536a = 25173,\ c = 13849,\ m = 65536
SymbolMeaningUnit
x0x_0the seed
xnx_nthe nth random number
 mod \bmodthe remainder after dividing
  • Mod means keep the remainder. 17 mod 5 is 2, because 17 = 3 × 5 + 2.
  • Change the seed by just 1 and the numbers scramble, so the world looks completely different.
  • These numbers only look random. Anyone with the same seed and formula gets the same ones, which is why players can share seeds.

Print this card

Where it’s used

  • Computer Science
    Games like roguelikes generate new levels from a seed, and speedrunners replay the same seed to race fairly.
  • Computer Science
    Scientists use seeded random numbers so others can repeat their simulations exactly.
  • Hobbies & Crafts
    Players share Minecraft seeds so friends can explore the exact same world.

Questions people ask

What is a world seed?

The starting number for the game's random-number formula. Every random choice when building the world comes from it, so the same seed always gives the same world.

Are the numbers really random?

No, they're pseudo-random. They follow a formula, but they jump around so much that they look random.

What does mod mean?

Divide and keep the remainder. It's the same math as a clock, where 13 o'clock wraps around to 1.

Updated : First published.

See everything that’s new on Maps for Math