Long before modern courts, constitutions, and legal codes, ancient societies faced a familiar problem: how can a community decide what is fair, punish wrongdoing, protect property, and keep order? One of the most famous answers came from Babylon nearly 4,000 years ago. Known today as Hammurabi’s Code, this collection of laws is among the oldest and most influential written legal systems in human history.
Created during the reign of King Hammurabi of Babylon, around 1754 BCE, the code was carved into a large stone monument and placed where people could see it. Its purpose was not only to record rules but also to present the king as a defender of justice. Although some of its punishments seem harsh by modern standards, Hammurabi’s Code marked a major step toward the idea that laws should be publicly known, consistent, and connected to the authority of the state.
The World of Ancient Babylon
Hammurabi ruled Babylon in Mesopotamia, a region between the Tigris and Euphrates rivers in what is now Iraq. Mesopotamia is often called the “cradle of civilization” because it was home to some of the earliest cities, writing systems, governments, and organized economies.
By Hammurabi’s time, Babylon had become a powerful kingdom. Its society included farmers, merchants, builders, priests, soldiers, slaves, and nobles. Trade was expanding, cities were growing, and daily life depended on complex relationships involving land, wages, debts, marriage, inheritance, and contracts. As society became more organized, disputes became more complicated.
A ruler who wanted to control such a kingdom needed more than military strength. He needed a way to regulate behavior and settle conflicts. Hammurabi’s Code helped serve that purpose. It offered a legal framework for a society in which agriculture, commerce, family life, and social hierarchy were deeply connected.
Who Was Hammurabi?

Hammurabi was the sixth king of the First Babylonian Dynasty. He ruled for more than four decades and transformed Babylon from a regional city-state into a major empire. Through military campaigns, diplomacy, and administration, he united much of Mesopotamia under his control.
Yet Hammurabi wanted to be remembered as more than a conqueror. In the text of the code, he presents himself as a king chosen by the gods to bring justice to the land. He claims his mission is to protect the weak from the strong, punish evil, and ensure order.
This royal image mattered. Ancient kings often justified their authority through religion, and Hammurabi was no exception. The famous stone stele that preserves his code shows him receiving authority from Shamash, the sun god and god of justice. This image sent a powerful message: the law was not merely the king’s personal preference, but part of a divine order.
What Was Hammurabi’s Code?
Hammurabi’s Code is a collection of 282 laws covering a wide range of topics. These include theft, assault, property damage, business contracts, wages, marriage, divorce, adoption, inheritance, medical fees, building standards, and slavery.
The laws were written in Akkadian using cuneiform script, a system of wedge-shaped marks pressed or carved into clay and stone. The best-known copy was carved into a black stone stele over seven feet tall. Rediscovered in 1901 at Susa, in modern-day Iran, it is now housed in the Louvre Museum in Paris.
The code is not a constitution in the modern sense, nor does it cover every possible legal issue. Instead, it reads like a series of case examples: “If a man does this, then this consequence shall follow.” This format made the laws practical and direct. It connected specific actions with specific penalties, creating a visible standard for judgment.
Justice Written in Stone
One of the most remarkable things about Hammurabi’s Code is that it was written down and displayed. In a world where many people could not read, the public monument still served an important symbolic purpose. It showed that the king’s justice was fixed, official, and meant to apply throughout the kingdom.
Written law creates a record. It reduces the possibility that decisions will be made entirely by personal whim, memory, or favoritism. Even if judges and officials still had power, the existence of a written code gave society a shared reference point.
This is why Hammurabi’s Code is often seen as a milestone in legal history. It did not invent law, and earlier legal collections existed in Mesopotamia, such as the Code of Ur-Nammu. However, Hammurabi’s Code is one of the most complete and famous surviving examples. Its scale, detail, and preservation make it a record-setting achievement in the history of justice.
An Eye for an Eye

Perhaps the most famous principle associated with Hammurabi’s Code is “an eye for an eye.” This idea, known as lex talionis, means that punishment should match the injury. If someone caused physical harm, the penalty could involve a similar harm being done to them.
To modern readers, this can sound brutal. However, in its historical context, the principle may have limited revenge rather than encouraged it. Without legal boundaries, retaliation could spiral into family feuds or ongoing violence. By setting a specific penalty, the law placed punishment under official control.
Still, the code did not treat everyone equally. Penalties often depended on social class. Hurting a nobleman might result in a harsher punishment than hurting a commoner or enslaved person. Compensation could vary depending on the victim’s status. This reminds us that ancient justice was closely tied to hierarchy.
Law, Class, and Inequality
Hammurabi’s Code reflected the social structure of Babylonian society. People were not equal before the law in the way modern democracies often claim citizens should be. The code recognized different categories of people, including free elites, commoners, and enslaved individuals.
For example, a crime against a person of high status could carry a severe physical penalty, while a similar crime against someone of lower status might require a payment. Enslaved people were often treated as property, and laws involving them focused heavily on ownership and economic value.
This inequality can be troubling, but it is also historically revealing. The code shows how ancient societies balanced justice with social order as they understood it. The goal was not equality in the modern sense. It was stability, hierarchy, and predictable consequences.
At the same time, the code did include protections for vulnerable people in certain situations. Widows, orphans, debtors, and wives appear in laws that attempted to regulate abuse, inheritance, and financial obligations. These protections were limited, but they show that the idea of justice included some responsibility toward those at risk.
Everyday Life in the Laws

One reason Hammurabi’s Code is so valuable to historians is that it reveals details about daily life. Its laws show what people worried about: stolen animals, damaged fields, unpaid debts, collapsed houses, failed surgeries, broken contracts, and family disputes.
Builders, for instance, faced serious consequences if a poorly constructed house collapsed and killed its owner. Farmers could be held responsible for careless irrigation that damaged a neighbor’s field. Doctors received set fees for successful treatments but could suffer harsh penalties for failure.
These laws show that Babylonian society depended on accountability. Work had standards. Contracts mattered. Property had to be respected. Families followed rules of marriage, divorce, and inheritance. The code gives us a window into a world where law touched nearly every part of life.
The Legacy of Hammurabi’s Code
Hammurabi’s Code did not directly create modern law, but it helped establish ideas that remain important. Written laws, public authority, proportional punishment, legal procedure, and state responsibility for justice all appear in some form within the code.
Its legacy is also symbolic. Hammurabi’s Code represents one of humanity’s earliest attempts to define justice in writing and connect it to governance. It reminds us that law is not just about punishment; it is about the organization of society.
Modern legal systems differ greatly from ancient Babylonian law. Today, many societies emphasize human rights, equality before the law, appeals, evidence, and protections against cruel punishment. Yet the basic desire behind legal systems remains familiar: people want rules that are known, judgments that are consistent, and power that is restrained by standards.
Why It Still Matters
Hammurabi’s Code matters because it shows how old the human search for justice really is. Thousands of years ago, people were already asking how to handle crime, debt, injury, family conflict, and professional responsibility. They understood that society needed rules and that those rules had to be recorded and enforced.
The code also challenges us to think critically about justice. Some of its laws seem wise in their demand for accountability. Others seem harsh or unequal. This mixture reminds us that legal systems are products of their time, shaped by values, fears, and power structures.
By studying Hammurabi’s Code, we do more than examine an ancient artifact. We encounter one of the earliest surviving statements of a principle that still shapes civilization: justice must be more than private revenge or personal command. It must be written, recognized, and connected to a larger vision of order. In that sense, Hammurabi’s record-setting code still speaks across the centuries.