A Short History of Random Numbers: From Knucklebones to Computers
By RithyVerse Studio · Updated October 12, 2026 · 3 min read
People have been using chance to make decisions for thousands of years. The tools have changed from animal bones to silicon chips, but the goal has stayed the same: to get an outcome that nobody can control. This short history shows how we got from ancient dice to the generator in your browser.
Ancient dice and casting lots
Among the earliest gaming pieces are knucklebones, the ankle bones of sheep and other animals, which were used in games and divination in the ancient world. Dice of various shapes have also been found at ancient sites in the Indus Valley, Mesopotamia and Egypt. Casting lots, which means drawing sticks, stones or marked objects, was used to divide land, choose leaders and settle disputes, because it was seen as a way to remove human bias.
The birth of probability
For centuries, gambling was a pastime without a theory. In the 17th century, correspondence between French mathematicians Blaise Pascal and Pierre de Fermat about a problem in dividing the stakes of an unfinished game of chance is often credited as the starting point of probability theory. From then on, randomness became something that could be studied with mathematics.
Tables of random digits
By the early 20th century, scientists needed unbiased numbers to choose samples and to run experiments. Early researchers produced tables of random digits by hand, drawing them from sources such as census figures or by using mechanical devices. The best-known is the RAND Corporation's book of one million random digits, published in 1955 and generated from electronic noise. It was widely used by statisticians and scientists for decades.
Computers and the first formulas
When electronic computers arrived, researchers wanted random numbers on demand. In the 1940s, John von Neumann proposed the middle-square method, which squares a number and takes the middle digits as the next value. It was simple but had weaknesses, including short cycles. Better methods followed, such as linear congruential generators in the 1950s and later the Mersenne Twister, published in 1997 by Makoto Matsumoto and Takuji Nishimura. It has an extremely long period and became the default in many programming languages, although it is not suitable for security.
The security era
As the internet grew, unpredictability became a matter of protecting secrets. Encryption keys, session tokens and passwords all depend on numbers that attackers cannot guess. Operating systems began gathering entropy from hardware events, such as timing between keystrokes, disk activity and dedicated hardware random sources, and feeding it into cryptographically secure generators. Weak randomness has been the cause of real security failures, which is why modern software relies on the operating system's secure source.
Randomness in your browser
Today, a web page can ask the browser for secure random values through the Web Crypto API. That is what Randomly uses, along with a technique called rejection sampling to ensure every number in your range has an equal chance. What once required a printed book of digits is now a single button on your phone. You can read how it works in How Random Number Generators Work.
Why the history matters
- People have always wanted a fair way to settle choices without bias.
- Good randomness has taken centuries of mathematics and engineering to achieve.
- The tools keep evolving, but fairness, transparency and unpredictability remain the standards.
Whenever you use chance to decide something, you are taking part in a very old tradition. Try the generator yourself, or compare real dice with the 3D dice roller.