When you think of the origins of the slot machine, you might picture the dusty saloons of the American Old West. But the fundamental mechanical principle that makes every slot machine work is far older, originating not in a saloon but in a sacred temple in 1st-century Roman Egypt. The inventor was the brilliant Greek engineer and mathematician, Hero of Alexandria, and his creation was the world’s first-ever vending machine.
An Invention for the Gods, Not for Gambling
Hero’s device was designed to solve a very practical problem in local temples: worshippers were taking more holy water than their donations warranted. To automate the process and ensure a fair exchange, Hero invented a machine that would dispense a set amount of liquid when a coin was inserted.
The mechanism was ingenious in its simplicity. When a person dropped a coin into a slot, the coin’s weight would fall onto a small pan attached to a lever. This lever would open a valve, allowing the holy water to flow out. As the pan tilted, the coin would eventually slide off, and a counterweight would snap the lever back into place, closing the valve and stopping the flow of water. It was a perfect, self-regulating system.

The Casino Connection: The “Coin-In, Result-Out” Mechanic
It is essential to understand that Hero’s vending machine was not a gambling device. There was no chance, no risk, and no variable prize. The outcome was always the same: one coin equaled one portion of holy water. However, it represents the absolute conceptual origin of the slot machine for one critical reason: it established the “coin-in, result-out” mechanic.
This is the fundamental principle that defines every slot machine:
- A user provides a standardized input (a coin or credit).
- The machine automatically performs an action without human intervention.
- The machine provides a standardized output or result.
Hero’s machine proved that an automated device could be trusted to execute a transaction. It was the first time a coin was used to activate a mechanism that dispensed a product. This core concept remained largely dormant for nearly 1,800 years until it was resurrected for a very different purpose.
From Holy Water to Jackpots
In the late 19th century, inventors like Charles August Fey took Hero’s “coin-in, result-out” principle and added the revolutionary element of chance. Instead of dispensing a guaranteed product like water, their new machines used a coin to trigger a spin of reels, delivering a random result. This result could be a loss, a small prize, or, if the player was very lucky, a large jackpot.
Without the foundational concept of an automated coin-operated dispenser, first realized by Hero of Alexandria, the modern slot machine as we know it could not exist. It is a remarkable journey for an idea—from ensuring piety in an ancient temple to powering the most popular and profitable game on the modern casino floor.
The Slot Machine’s Ancient Roots — Frequently Asked Questions
Who invented the first slot machine?
The mechanical slot machine is usually credited to Charles Fey of San Francisco, who built the Liberty Bell in 1895. But Fey’s invention had ancient predecessors — the conceptual ancestor is Hero of Alexandria’s coin-operated holy water dispenser, built around 50 CE. Hero’s device used a coin’s weight to tip a balance, releasing a measured amount of water. The basic principle (insert coin → mechanism delivers product) was invented nearly two thousand years before Fey.
What was Hero’s vending machine?
Described in Hero of Alexandria’s treatise Pneumatica (1st century CE), it was a coin-operated dispenser placed in Greek and Roman temples. Worshippers dropped a 5-drachma coin into a slot; the coin landed on a balance arm that lifted briefly, opening a valve and releasing a small amount of holy water for ritual use. Once the coin slid off the arm, the valve closed.
How is the slot machine related to Hero’s device?
Both share the same fundamental mechanism: a customer inserts coinage, internal machinery activates, and the device delivers a result. Hero’s “result” was holy water; Fey’s was either a small payout in drinks/cigars (the Liberty Bell wasn’t initially a cash machine) or, in later versions, coins. The modern slot machine is the same idea with a randomisation layer added.
Why is gambling so old?
Dice have been found in archaeological contexts dating back to at least 3000 BCE in Mesopotamia and Egypt. Lottery-style games are documented in ancient Chinese sources from around 200 BCE (used to fund state projects, including parts of the Great Wall). The human desire to wager on uncertain outcomes appears to be a near-universal cultural feature.
Did Hero of Alexandria invent gambling devices?
Not gambling specifically — Hero’s device was a transactional vending machine for sacred water, not a chance-based payout. But the mechanical lineage from Hero through medieval coin-operated mechanisms to Fey’s Liberty Bell is direct. The randomisation that distinguishes a modern slot machine from a vending machine is a later innovation, mostly Victorian and 20th-century.
What other ancient gambling devices existed?
Knucklebones (ancestors of dice) were used for gambling games across the Mediterranean from at least 3000 BCE. Loaded dice — designed to cheat — have been excavated from Pompeii, proving Romans gambled and that they cheated at it. Lot-casting devices are documented in the Old Testament and in Greek temple records.
The History of Roulette
From Pascal’s experiment to the modern wheel.
The History of Craps
From Hazard to the modern pass line.
Modern Sites for Casino Games
Where to play roulette today (US).


