Most people have heard of Hammurabi’s Code, usually as the origin of “an eye for an eye.” But the real story is stranger and more interesting. The Babylonian king’s laws were not the first ever written, they were not applied the way we apply laws today, and some of the most important legal codes of the ancient world survive only in fragments, or only because later writers quoted them.
This article looks at Hammurabi’s laws, several other lost or partly lost codes, and what they tell us about how people have thought about justice for four thousand years.
Why Write Laws Down at All?
Before written law, rules lived in custom and in the memory of those in power. A ruler or elder decided disputes, and ordinary people could not know in advance what the rules were. Writing laws down changed that. Once a rule is carved in stone or posted in public, it can be read, argued about, and used to limit what authorities may do.
Key Takeaways
- Hammurabi’s Code was not the first. The Code of Ur-Nammu is about three centuries older, and other Mesopotamian laws also came before it.
- “An eye for an eye” was not equal justice. Penalties depended on the victim’s social rank, so the same harm carried different consequences.
- Compensation is an ancient idea. Ur-Nammu and the Hittite laws favored payment over bodily punishment, much like many modern systems.
- Professionals were held responsible. A builder whose faulty house killed its owner could be put to death, an early form of liability for negligence.
- It may not have been a statute book. Court records rarely cite the laws, so historians debate whether it was a binding code, a set of model rulings, or royal self-presentation.
- Many codes survive only in pieces. Draco’s laws and the Twelve Tables are known mostly through later writers who quoted them.
- Writing and publishing laws limited power. Public laws let people know the rules and made rulers accountable, which is the root of the rule of law.
That idea, that the law should be knowable, is still the foundation of the rule of law today.
The Code of Ur-Nammu: Older Than Hammurabi
The oldest surviving law code we know of is the Code of Ur-Nammu, from the Sumerian city of Ur, dating to roughly 2100 to 2050 BCE. That is about three centuries before Hammurabi. It survives only in damaged clay tablets, assembled from fragments found at sites such as Nippur and Ur.
What stands out is how it handles injury. Many of its provisions set financial penalties, such as a fixed amount of silver for a broken bone, rather than physical retaliation. Historians often point to this as evidence that the idea of compensation rather than revenge is older than the famous “eye for an eye” rule.
Hammurabi’s Code
Hammurabi ruled Babylon in the 18th century BCE, and his laws were inscribed on a tall black diorite stele, roughly two and a quarter meters high. The monument has a prologue, a long list of laws (usually counted at around 282), and an epilogue. At the top, a carved relief shows the king standing before the sun and justice god Shamash.
The stele has its own odd history. It was not found in Babylon. It was carried off as war booty by an Elamite king centuries later and was rediscovered in 1901 and 1902 by a French archaeological team at Susa, in modern Iran. It is now in the Louvre in Paris.

What the Laws Actually Say
The laws cover an astonishing range of daily life: trade, loans, farming, marriage, inheritance, medical practice, building, and boat hire. A few examples show the flavor:
- False accusation. An early provision says that someone who accuses another of a capital crime and cannot prove it can face death themselves. It is a blunt way of discouraging reckless accusations.
- Building safety. If a house collapses and kills its owner because it was badly built, the builder can be put to death. The principle, that professionals are responsible for the harm their work causes, still echoes in modern negligence law.
- Debt. Provisions limit how long a person could be held in debt servitude, to three years, which was a form of early protection for borrowers.
- Contracts. Marriage and many business arrangements required written agreements to be legally recognized.
“An Eye for an Eye” Was Not Equal for Everyone
The famous retaliation rule appears, but with an important catch. If a man destroys the eye of a member of the upper class, his own eye is destroyed. If the injured person is a commoner, the penalty is a payment of silver. If the injured person is a slave, the penalty is smaller still.
So Hammurabi’s justice was graded by social rank. Equal punishment for equal harm was not the principle. The same act could carry very different consequences depending on who the victim was.
Was It Really a “Code”?
Here is a point that surprises many readers. Historians debate whether Hammurabi’s laws functioned as a statute book at all. Surviving court records from the period rarely cite the laws directly when deciding cases. Some scholars see the monument as a statement of royal ideals, almost a public relations piece showing that the king was a wise and just ruler. Others see it as a collection of model judgments used to teach scribes and judges.
The epilogue states the purpose clearly: the king wanted to protect the weak from the strong. Whether or not judges applied each rule, the monument shows how rulers wanted to be seen, as guardians of justice.
Other Lost and Partial Codes
Hammurabi’s stele survived nearly whole, which is why it is famous. Many other codes did not.

- Laws of Eshnunna and Lipit-Ishtar (around 1930 BCE). Two other Mesopotamian collections, also from before Hammurabi, preserved on tablets. They show that Babylonian law drew on a shared legal tradition.
- Hittite Laws (about 1650 to 1500 BCE). Found in the Hittite archives in modern Turkey, they lean heavily toward compensation over punishment for many offenses.
- Middle Assyrian Laws (around the 11th century BCE). Known for harsh provisions, particularly toward women, and a good reminder that ancient law was not uniformly moderate.
- Draco’s laws in Athens (about 621 BCE). Draco’s code was so severe that we still use the word “draconian.” Almost none of it survives, apart from part of the homicide law. Solon later repealed most of it.
- The Gortyn Code (around the fifth century BCE). A Greek law inscribed on the wall of a building in Crete, covering family law, property, and inheritance in unusual detail.
- The Twelve Tables of Rome (about 451 to 450 BCE). Roman law’s founding text was displayed publicly so citizens could read it. The original bronze or wooden tablets are lost. What we know comes from quotations by later Roman writers.
The Twelve Tables are a special case. We know them only through the writers who quoted them, which is a reminder of how fragile legal memory can be.
What These Codes Say About Justice
Across these ancient laws, several lessons keep appearing.
1. Justice has always been tied to power. Many codes were issued by kings, and the surviving texts present the ruler as the source of justice. Law and authority were inseparable.
2. Proportionality is an old idea, and a flawed one. Setting a punishment to match the harm was a real advance over unlimited revenge. But when the penalty depended on the victim’s rank, proportionality coexisted with inequality.
3. Compensation versus punishment is an ancient debate. Ur-Nammu and the Hittites leaned toward payment. Others leaned toward bodily penalties. Modern systems still balance these two approaches.
4. Publicity is a form of fairness. Whether on a stone monument in Babylon or in the Roman Forum, displaying laws publicly meant that rulers could be held to them, at least in principle.
5. Written law can be ideal rather than practice. The gap between what the law says and what courts do is not new. It is just as important to ask how laws were used as to ask what they said.
Why Lost Codes Still Matter
Ancient laws are easy to dismiss as harsh and foreign. But they show that people have been trying to answer the same questions for millennia. Who decides what is fair? How do we stop the powerful from abusing the weak? How should we respond to harm? Hammurabi’s likeness appears among the great lawgivers honored in the sculpture of the United States Supreme Court building, a sign of how far these ideas reach.

The codes that survive are only a sample. For every stele that was found, others were destroyed, buried, or never recorded. The law we can read today is the part of the ancient world’s legal thought that happened to last.
Frequently Asked Questions
No. The Code of Ur-Nammu is older, and other Mesopotamian collections also predate Hammurabi. His stele is the best preserved and most famous.
It is displayed at the Louvre Museum in Paris.
Not exactly. The retaliation rule applied between people of equal rank. Harm to people of lower social status brought different, usually lighter penalties.
Historians are not sure. Court records rarely cite the laws directly, so scholars debate whether the monument was a binding code, a set of model rulings, or a statement of royal ideals.
Later Roman authors quoted from them extensively, allowing scholars to reconstruct much of the text.
This article is for general educational and historical interest and is not legal advice. Dates for ancient laws are approximate and scholars sometimes disagree about them.