What is the Code of Hammurabi? It is one of the oldest and best-known collections of laws from ancient Mesopotamia, created under the Babylonian king Hammurabi, who ruled in the 18th century BCE. The code is famous not because it was the first law code, but because it survives in a nearly complete form and shows how a powerful ancient state tried to regulate justice, property, family life, and social order.
Its rules were carved on a tall stone stele and set up publicly, probably around 1754 BCE. The text gives historians a rare window into Babylonian society, revealing both the ideals of royal justice and the inequalities built into ancient law.
What Is the Code of Hammurabi?
The Code of Hammurabi was a royal law collection issued in ancient Babylon during the reign of Hammurabi, roughly 1792–1750 BCE. It contains nearly 300 laws covering crime, trade, marriage, inheritance, labor, and injury. Rather than a modern constitution, it was a statement of royal authority and a guide to justice in the king’s realm.
A law code, not a modern legal system
The word “code” can be misleading. Hammurabi’s laws were not a single all-encompassing legal system applied in the modern sense. They were a written collection of judgments and legal principles, likely meant to present the king as a just ruler chosen by the gods. Some laws may have reflected actual court practice, while others may have been idealized examples of how justice should work.
Why it matters
The Code of Hammurabi matters because it is one of the clearest surviving sources for understanding ancient Mesopotamian society. It shows the importance of social rank, the role of family and property, and the belief that law should be publicly displayed. It also became famous in later history as a symbol of early legal thought.
Background: Babylon and Mesopotamia in Hammurabi’s Time
Hammurabi ruled in Mesopotamia, the region between the Tigris and Euphrates rivers, in what is now modern Iraq. This was a politically fragmented world of city-states and rival kingdoms. Babylon, once a smaller city, rose to power under Hammurabi and became a major political center in southern Mesopotamia.
The Old Babylonian period
Hammurabi belonged to the Old Babylonian period, when kings competed for control of land, irrigation systems, trade routes, and labor. Warfare, diplomacy, and alliances were constant features of politics. In that setting, law was not separate from kingship; it was part of how rulers claimed legitimacy and maintained order.
Hammurabi the king
Hammurabi is remembered today mainly for his law code, but he was also a successful ruler and military leader. Over time, he expanded Babylon’s influence across much of southern Mesopotamia. His reign helped transform Babylon from one kingdom among many into a dominant power. The laws associated with his name reflect that broader project of state-building.
Origins of the Code
The Code of Hammurabi was likely compiled near the end of Hammurabi’s reign, around 1754 BCE, though exact dating is approximate. The surviving version was inscribed on a large diorite stele discovered in modern times at Susa, in present-day Iran, where it had been taken as booty centuries later. The original monument was probably displayed in Babylon.
How the text was created
Scholars generally believe the code was based on earlier legal traditions in Mesopotamia, not invented from nothing. Earlier rulers had issued law collections, and scribes had long experience recording contracts, disputes, and court decisions. Hammurabi’s version stands out because of its scale, literary framing, and survival.
The prologue and epilogue
The stele begins and ends with a royal message. In the prologue, Hammurabi presents himself as a shepherd-like ruler appointed by the gods to bring justice and protect the weak. In the epilogue, he warns future rulers not to alter the laws. These sections are crucial because they show the code was meant to project authority as much as to regulate behavior.
What Did the Code of Hammurabi Say?
The laws cover a wide range of everyday concerns, including theft, violence, marriage, divorce, debt, slavery, wages, trade, farming, and professional responsibility. Many laws use a strict “if… then…” format. The code is especially known for the principle of retaliation often summarized as “an eye for an eye,” though that phrase oversimplifies the text and its context.
Common themes in the laws
- Property and theft: The code sets punishments for stealing livestock, crops, goods, or temple property.
- Family law: It addresses marriage, adultery, inheritance, adoption, and divorce.
- Commercial life: It regulates loans, contracts, wages, and commercial disputes.
- Labor and agriculture: It includes rules for irrigation, farming obligations, and hired work.
- Violence and injury: It distinguishes punishments based on the social status of the people involved.
Social inequality in the law
One of the most important facts about the code is that it did not treat everyone equally. Punishments often depended on whether a person was a free elite, a commoner, or an enslaved person. This means the code reflects a hierarchical society, not a modern idea of equal justice. The same injury could lead to different penalties depending on rank.
The famous “eye for an eye” idea
The code is often linked to the principle of talion, or equal retaliation. In some cases, the punishment mirrors the harm done. But the reality is more complicated. The laws also include fines, compensation, and status-based penalties. The code is therefore better understood as a mix of retribution, compensation, and social control.
How Was the Code Used in Practice?
Historians debate how directly the Code of Hammurabi was applied in everyday courts. It may not have functioned as a strict legal manual that judges consulted line by line. Instead, it may have served as a public monument to royal justice, a teaching text for scribes, and a statement of legal ideals. Court records from Mesopotamia show that actual legal practice could be more flexible than the code suggests.
Law in ancient Mesopotamia
Ancient Mesopotamian legal life relied heavily on witnesses, contracts, oaths, and local authorities. Written documents mattered, especially in trade and property disputes. The code fits into this world, but it does not replace it. It gives us a formal picture of justice, while other records show the practical workings of law.
Why scholars are cautious
Because the code survives as a monumental inscription rather than a courtroom handbook, historians avoid assuming every law was enforced exactly as written. Some provisions may have been symbolic, exemplary, or rarely invoked. The text is still invaluable, but it must be read alongside other evidence from Mesopotamian archives.
Key Facts About the Code of Hammurabi
- Approximate date: c. 1754 BCE, during Hammurabi’s reign.
- Region: Babylon in Mesopotamia, modern-day Iraq.
- Material: Inscribed on a stone stele of diorite.
- Discovery: Found at Susa in 1901–1902 by French excavators.
- Current location: The stele is housed in the Louvre Museum in Paris.
- Length: About 282 laws in the surviving text, though numbering can vary by edition.
Discovery and Modern Significance
The stele was discovered in the early 20th century at Susa, where it had been moved long after Hammurabi’s reign, likely by Elamite conquerors. Its rediscovery made the code famous worldwide and helped historians compare Mesopotamian law with legal traditions from other ancient societies, including those of the Hebrew Bible and later Near Eastern kingdoms.
Influence and comparison
Scholars have long compared the Code of Hammurabi with other ancient legal texts. Similarities exist in style, subject matter, and concerns about justice, but direct borrowing is often hard to prove. The code is best understood as part of a broader ancient Near Eastern legal culture rather than as a lone invention.
Legacy in history
In modern times, the code has become a symbol of early law, state power, and the idea that rulers should publicly define justice. It is often cited in discussions of legal history, though it should not be treated as the origin of law itself. Many societies had rules, customs, and legal institutions long before Hammurabi.
Why the Code Still Matters Today
The Code of Hammurabi remains important because it reveals how an ancient state imagined order, authority, and fairness. It shows a world where law protected property and hierarchy, but also where rulers claimed responsibility for the vulnerable. It is both a legal document and a political monument, and that combination is what makes it so historically rich.
In short, the Code of Hammurabi was a public statement of Babylonian law and kingship, created in the 18th century BCE and preserved on a stone monument. It is not the first law code in history, but it is one of the most influential and best preserved. For related context, you can also explore what happened to Babylon and what was the first war.