The Code of Hammurabi
One of history's most famous early codes of public law (the older Code of Ur-Nammu, c. 2100 BCE, predates it).
Explore this event on the interactive timeline →Babylonian King Hammurabi enacted a code of 282 laws carved onto a massive stone stele and placed in public. It established clear standards for commercial interactions and set fines and punishments to meet the requirements of justice.
Key Numbers
- Date inscribed
- c. 1755-1750 BCE
- Number of laws
- 282 case provisions
- Stele height
- 2.25 m (7 ft 4 in)
- Social classes in law
- 3 (awilum, mushkenum, wardum)
- Rediscovered
- 1901, at Susa
Verified Facts
- Hammurabi was the sixth king of the First (Amorite) Dynasty of Babylon, reigning roughly 1792-1750 BCE, and issued the laws near the end of his reign after unifying much of Mesopotamia by conquest.
- The roughly 7-foot-4-inch stele was carved in Akkadian cuneiform, with about one-fifth of the text devoted not to laws but to a poetic prologue and epilogue written in the style of a royal inscription glorifying the king.
- The relief at the top depicts Hammurabi standing before Shamash, the enthroned sun god and god of justice, who hands the king the rod and ring of authority; in the prologue Hammurabi claims a divine mandate 'to prevent the strong from oppressing the weak.'
- It is famous for the principle of lex talionis ('an eye for an eye, a tooth for a tooth'), but this retribution applied only between social equals of the highest class; injuries to people of lower status were settled with fixed silver payments instead.
- The law distinguished three classes: the awilum (free person of full standing), the muskenum (a free commoner of lower rank, possibly a palace dependent), and the wardum (slave), with penalties and compensation scaled to the rank of both offender and victim.
- Law 229 decreed that if a builder constructed a house so poorly that it collapsed and killed the owner, the builder himself was to be executed, an early expression of professional liability through physical punishment.
- Many scholars argue the monument was less a working statute book than royal propaganda: in the surviving court records from Hammurabi's reign and after, no verdict cites the stele's laws as the basis for a decision.
- The stele was not found in Babylon but at Susa in modern Iran, where the Elamite king Shutruk-Nahhunte carried it off as war plunder around 1158 BCE, erasing several columns apparently to add his own inscription (which he never carved).
- It was rediscovered in three pieces in 1901 by an expedition led by Jacques de Morgan, with the text first published by the Assyriologist Jean-Vincent Scheil; it has been displayed in the Louvre ever since.
- Hammurabi's was not the first law collection: it was preceded by centuries by the Sumerian Code of Ur-Nammu (c. 2100 BCE), the oldest surviving law code, as well as the Laws of Lipit-Ishtar and the Laws of Eshnunna.
The World at This Moment
Hammurabi reigned c. 1792-1750 BCE (middle chronology), and the stele was inscribed near his reign's end, c. 1755-1750 BCE. By then he had unified Mesopotamia, defeating Rim-Sin of Larsa, Zimri-Lim of Mari, and Eshnunna, ending the fragmented "Age of the Amorite kingdoms." Contemporaneously, Egypt's Middle Kingdom was fracturing into the Second Intermediate Period, soon dominated by the Hyksos. The Indus Valley (Harappan) civilization was entering its Late period of decline. China's Shang dynasty had not yet emerged (c. 1600 BCE); the Minoan palace culture flourished on Crete. The code was not an isolated invention: it stood in a Mesopotamian legal tradition stretching back through the Sumerian Laws of Ur-Nammu (c. 2100 BCE), the Laws of Lipit-Ishtar of Isin, and the Laws of Eshnunna. Cuneiform scribal culture, the sexagesimal mathematics later underlying our 60-minute hour, and Akkadian as the diplomatic lingua franca all framed this moment of Babylonian ascendancy.
The Paradigm Shift
Hammurabi's monument is the most complete surviving expression of an emerging Near Eastern idea: that royal legitimacy rests on the king's duty to deliver justice (Akkadian misharum, kittum) rather than mere conquest. Its roughly 282 provisions, framed in casuistic "if a man... then..." form, articulate graduated penalties tied to social rank (awilum, mushkenum, wardum) and crystallize the lex talionis ("an eye for an eye"). Whether or not judges actually cited it, the stele transmitted a durable template: written, publicly displayed norms answerable to divine sanction, with the sun-god Shamash, patron of justice, depicted handing Hammurabi the emblems of authority. Its phrasing and casuistic structure influenced later collections, including the Covenant Code of Exodus, prompting more than a century of comparison. As the earliest extensively preserved law collection, it shaped the modern Western imagination of "the first law code" and anchors how legal historians narrate the origins of codified, state-backed justice, even as specialists now dispute that framing.
In Their Own Words
"Anu and Bel called by name me, Hammurabi, the exalted prince, who feared God, to bring about the rule of righteousness in the land, to destroy the wicked and the evil-doers; so that the strong should not harm the weak." — Prologue to the Code of Hammurabi, in the translation of L.W. King (1915); the same passage appears in Robert Francis Harper's 1904 edition.
then Anu and Bel called by name me, Hammurabi, the exalted prince, who feared God, to bring about the rule of righteousness in the land, to destroy the wicked and the evil-doers; so that the strong should not harm the weak; so that I should rule over the black-headed people like Shamash, and enlighten the land, to further the well-being of mankind.
Code of Hammurabi, Prologue, c. 1754 BCE; English translation by L. W. King (1915), as hosted by the Avalon Project, Yale Law School. (Babylonian original; King's is the standard early-20th-century rendering.) — source
If a man put out the eye of another man, his eye shall be put out. [ An eye for an eye ] ... If a man knock out the teeth of his equal, his teeth shall be knocked out. [ A tooth for a tooth ]
Code of Hammurabi, Laws 196 and 200 (lex talionis); trans. L. W. King (1915), Avalon Project, Yale Law School. The bracketed glosses are King's editorial labels, not part of the Akkadian original. Note: the original applies this to men of equal rank only; injuring a commoner is penalized by a silver fine (Law 198). — source
the orphan did not fall a prey to the wealthy, the widow did not fall a prey to the powerful, the man of one shekel did not fall a prey to the man of sixty shekels
Code of Ur-Nammu, Prologue, c. 2100-2050 BCE (Sumerian; roughly three centuries older than Hammurabi's code); trans. Samuel Noah Kramer (1954), as cited by the World History Encyclopedia. Included for the alternative-perspective comparison. — source
In Depth
Justice in Stone: How Hammurabi Froze Law Into Permanence
Around 1754 BC, a Babylonian king ordered 282 verdicts carved in Akkadian cuneiform onto a seven-foot diorite stele, crowned by a relief of himself receiving the rod and ring of authority from Shamash, the sun god of justice. The Code of Hammurabi is not the first law code — that distinction belongs to the Sumerian Code of Ur-Nammu three centuries earlier, followed by the Laws of Eshnunna and Lipit-Ishtar — but it is the most complete, most monumental, and most influential to survive. It marks the moment human society discovered that authority could be made permanent, public, and impersonal by writing it down.
The Preconditions: Cities, Surplus, and Script
Hammurabi's stele is unthinkable without two prior revolutions. The Agricultural Revolution (sv-agriculture) created the grain surplus that fed cities, and surplus created strangers — people who farmed, lent, married, and quarreled without the kinship bonds that govern small bands. Disputes between strangers demand an external referee, and that referee needs a memory more durable than a chieftain's word. That memory was the second precondition: the Invention of Cuneiform (sv-cuneiform), the Mesopotamian writing system born for accounting that here matures into an instrument of governance. The same script that produced the Epic of Gilgamesh (sv-gilgamesh) now fixes the price of an ox and the penalty for a broken bone. Hammurabi's genius was less legal than rhetorical: by placing the laws beneath an image of divine investiture, he claimed that justice flowed from heaven through the king to the people, making the code both statute and propaganda.
What the Code Made Possible
The famous principle — "if a man destroy the eye of another man, they shall destroy his eye" — is the lex talionis, an eye for an eye. Modern readers recoil, but in context it was a restraint: it capped vengeance at proportionality and substituted the state for the blood-feud. Crucially, the penalties varied by social class, encoding a stratified society of nobles, commoners, and slaves into permanent text. This is law as both protection and hierarchy.
The deeper legacy is the idea that rules should be written, displayed, and applied beyond the ruler's whim — a seed that flowers across the whole arc of governance. Its echoes run through the Mosaic law that later Israelite scribes composed, through the Birth of Democracy in Athens (sv-athenian-democracy), where written constitutions replaced aristocratic memory, and onward to the Roman Republic (sv-roman-republic), whose Twelve Tables made the same bet that justice means published, knowable rules. The thread continues to the Federalist Papers (sv-federalist-papers) and the American Revolution (sv-american-revolution), where a written constitution placed even the executive under text. Every society that insists the law be visible to the governed is, in a sense, standing where Hammurabi stood before Shamash.
Threads Forward and the Fragility of Order
The code is also a document of its moment's vulnerability. Hammurabi's Babylon was a brief consolidation; the stele itself was looted centuries later by an Elamite king and carried to Susa, where French archaeologists found it in 1901 — a reminder that the written order it proclaimed could not survive the convulsions that produced the Late Bronze Age Collapse (sv-bronze-collapse). Codified law outlived the empire that wrote it precisely because it was portable text rather than living custom.
In the long view of a Big Bang–to–AGI timeline, Hammurabi's stele is an early node in humanity's project of externalizing rules into durable media. The lineage runs from cuneiform clay to the printing press, from statute books to the World Wide Web (sv-www), and toward the present challenge of encoding human values into machines. When researchers today debate how to align an artificial intelligence with binding principles, they are wrestling with Hammurabi's original problem: how to make justice explicit, permanent, and answerable to something higher than the one who holds power.
Causes & Consequences
What led to it
- The invention and refinement of cuneiform writing in Mesopotamia, adapted to record the Akkadian language, gave Hammurabi's scribes the technical means to inscribe a long, organized legal text in stone and on clay.
- A century of Old Babylonian scribal schools (the edubba or "tablet house") trained literate professionals in Sumerian and Akkadian who could draft, compile, and copy the roughly 282 case-law provisions that make up the code.
- Earlier Mesopotamian law collections, especially the Sumerian Code of Ur-Nammu (c. 2100-2050 BCE), set the legal-casuistic template of conditional "if a man does X, then Y" provisions that Hammurabi's code follows.
- The intermediate codes of Lipit-Ishtar of Isin (c. early 20th century BCE) and the Laws of Eshnunna (c. 1930 BCE) further developed this legal tradition and supplied content and structure that influenced Hammurabi's compilation.
- Hammurabi's military unification of Mesopotamia, including his conquests of Larsa, Eshnunna, and Mari by around 1750 BCE, created a single Babylonian-ruled realm that needed and could project a unified standard of royal justice.
- The Mesopotamian ideology of kingship as a divine mandate, expressed through the sun god Shamash as god of justice, gave Hammurabi the religious legitimacy he invoked to present himself as the gods' chosen agent for establishing order.
What it set in motion
- The roughly 2.25-meter basalt stele displayed Hammurabi's justice publicly and, depicting Shamash conferring authority on the king, became an enduring model of law as divinely sanctioned royal propaganda.
- The code was copied and studied by Mesopotamian scribes for over a millennium, with fragments on clay tablets dating as late as the 5th century BCE, making it a foundational text in scribal training and legal culture.
- Its principle of proportional retaliation (lex talionis, "an eye for an eye") shaped later Near Eastern legal thinking and finds a famous parallel in the biblical Mosaic law of retaliation.
- It influenced the form and vision of subsequent legal collections such as the Middle Assyrian Laws and the Neo-Babylonian Laws, extending its casuistic model across later Mesopotamian civilizations.
- The Elamite king Shutruk-Nahhunte carried the stele off to Susa as war plunder around 1158 BCE, which paradoxically preserved it and allowed a French expedition under Jacques de Morgan to rediscover it there in 1901-1902.
- Now housed in the Louvre, the rediscovered code became one of the most studied artifacts of ancient law, central to modern scholarship on early legal systems and to debates over the relationship between Babylonian and biblical law.
The Live Academic Debate
A live debate concerns the stele's purpose. The nineteenth-century view treated it as legislation, a binding statute book. Assyriologists since the 1960s have largely overturned this. J.J. Finkelstein argued it functioned as a royal apologia, a monument advertising Hammurabi as the just king before the gods, not a working code judges consulted; tellingly, thousands of Old Babylonian trial records never cite it. Raymond Westbrook contended the collection reflects a shared, traditional, largely oral "common law" of the cuneiform world, the written text being descriptive scholarship rather than prescriptive enactment. Martha T. Roth, whose Law Collections from Mesopotamia and Asia Minor (1995) is the standard edition, stresses the texts as a scribal/scholarly genre and cautions against the anachronistic word "code." Others propose it served as a model for legal reasoning or a compilation of paradigmatic cases. A connected debate, energized by Albrecht Alt's form-critical work and later comparativists, weighs how directly Hammurabi's provisions influenced biblical law versus reflecting common regional inheritance.
Not the first, and not simply Moses' source: Hammurabi in the wider Near Eastern legal tradition
Hammurabi's stele is the most complete ancient law code but not the oldest: the Sumerian Code of Ur-Nammu (c. 2100-2050 BCE), translated by Samuel Noah Kramer, predates it by roughly three centuries and already frames the king as protector of the orphan and widow against the rich and powerful. On the much-debated link to the Mosaic 'eye for an eye' (Exodus 21:23-25), the Cambridge Hebraist David Winton Thomas cautioned that 'There is no ground for assuming any direct borrowing by the Hebrew from the Babylonian. Even where the two sets of laws differ little in the letter, they differ much in the spirit.' The scholarly consensus today favors shared, inherited Near Eastern legal traditions over direct copying.
The Counterfactual
Had Hammurabi never inscribed this stele, the broader Mesopotamian legal tradition would have survived regardless: the Laws of Ur-Nammu, Lipit-Ishtar, and Eshnunna already establish that casuistic, ranked-penalty law collections were a recurring royal genre, not a Babylonian novelty. So the deeper structures of cuneiform jurisprudence would persist. What would be lost is the singularly complete, publicly monumentalized exemplar. Counterfactually, our modern picture of ancient law would rest on more fragmentary witnesses, and the popular shorthand "an eye for an eye = Hammurabi" would attach elsewhere or dissolve. The diorite stele's survival owes much to contingency: the Elamite king Shutruk-Nahhunte carried it as plunder to Susa c. 1158 BCE, where Jacques de Morgan's French expedition recovered it in 1901-02. Without that looting-and-burial accident, the text might survive only in scattered tablet copies, as many ancient works do. The genre's existence was not contingent; this iconic artifact's preeminence largely was.
Myth vs. Reality
Myth: The Code of Hammurabi was the world's first written law code.
Reality: It was not the first. The Code of Ur-Nammu (c. 2100-2050 BCE) predates it by roughly three centuries, and the Laws of Lipit-Ishtar and the Laws of Eshnunna also came before Hammurabi (who reigned c. 1792-1750 BCE). Hammurabi's collection only seemed to be the oldest because its stele was unearthed first, at Susa in 1901, while Ur-Nammu's text was not identified until the 1950s. Its enduring fame comes from being the most extensive and best-preserved of these early collections, not from being the earliest.
Myth: It established 'an eye for an eye' as a universal standard of equal justice for everyone.
Reality: The talionic ('eye for an eye') penalties applied only between social equals. Babylonian society recognized distinct classes, principally the awilum (free person of standing), the mushkenum (a free person of lower status), and the wardum (slave), and punishment depended on the status of both offender and victim. Law 196 prescribes that an awilum who blinds another awilum loses his own eye, but Law 198 fixes a payment of sixty shekels of silver if the victim is a mushkenum, and a payment to the owner if the victim is a slave. Justice was scaled by social rank, not applied equally.
Myth: The code was binding legislation that judges in Babylonia consulted and enforced like a modern statute book.
Reality: Many Assyriologists doubt that the stele functioned as enforceable legislation. Thousands of surviving Babylonian legal and court records from the period never cite the 'code,' and some documented verdicts diverge from its provisions. Scholars such as Jean Bottero argued it reads more like a royal monument celebrating Hammurabi as a just king, and others (e.g. Reuven Yaron) have called the very label 'code' a misnomer, proposing instead that it was a record of model judgments or a work of scholarly jurisprudence rather than a prescriptive statute.
Myth: The carving at the top of the stele shows Hammurabi handing down or dictating the laws to his people.
Reality: The relief actually depicts Hammurabi standing before a seated deity, generally identified as Shamash, the sun god and god of justice (some scholars suggest Marduk). The god extends the rod-and-ring, symbols of divinely sanctioned authority, to the king. Hammurabi is the recipient who is being authorized to administer justice, not a figure dictating law. The scene asserts that royal authority and just rule are granted by the gods, framing the king as a pious agent of divine justice.
Myth: Hammurabi personally invented all 282 laws from scratch.
Reality: The collection drew heavily on a long-standing Mesopotamian legal tradition rather than springing wholly from one ruler. Many provisions parallel earlier collections such as the Laws of Ur-Nammu, Lipit-Ishtar, and Eshnunna, and the text integrated established Sumerian and Akkadian legal customs. Hammurabi's achievement lay in compiling, organizing, and monumentalizing this inherited material under his royal name, presenting himself as the guarantor of justice, rather than in originating the legal principles outright.
Frequently Asked Questions
What is the Code of Hammurabi?
The Code of Hammurabi is a Babylonian legal text compiled around 1755-1750 BC during the reign of Hammurabi, the sixth king of the First Dynasty of Babylon. Written in the Old Babylonian dialect of Akkadian, it contains 282 laws framed in casuistic 'if...then...' format, bracketed by a poetic prologue and epilogue. It is the longest, best-organized, and most completely preserved legal document surviving from the ancient Near East.
What does 'an eye for an eye' mean in the Code of Hammurabi?
The phrase reflects the principle of lex talionis, the law of retaliation, in which a punishment mirrors the harm done. Law 196 famously states that if a man destroys the eye of another man, his own eye shall be destroyed. Importantly, this strict retaliation applied mainly among social equals; injuries to people of lower status were often settled with a fixed payment of silver instead.
Was the Code of Hammurabi the first written law code?
No. Although it is the most famous ancient law collection, it was preceded by earlier Mesopotamian codes. The Code of Ur-Nammu (c. 2100-2050 BC) is the oldest law code surviving today, and the Sumerian Code of Lipit-Ishtar predates Hammurabi by roughly two centuries. Even earlier reforms attributed to Urukagina (24th century BC) are known, though only through later references.
Where is the Code of Hammurabi today and how was it found?
The principal surviving copy is a basalt stele about seven feet tall, now housed in the Louvre Museum in Paris. It was unearthed in the winter of 1901-1902 by a French archaeological expedition led by Jacques de Morgan at Susa, in present-day southwestern Iran. The stele had been carried there as war booty centuries after its creation by the Elamite king Shutruk-Nahhunte.
How did punishments in the Code differ by social class?
The code recognized broad social categories, commonly rendered as the awilu (free person), the mushkenu (commoner or dependent), and the wardu (slave), and penalties varied with the status of the parties involved. Retaliatory punishment generally applied between equals, while harm to those of lower rank was typically compensated with silver. For example, causing a miscarriage in a woman of the awilu class carried a larger fine than the same injury to a mushkenu or wardu woman.
Did the Code of Hammurabi actually function as law in Babylon?
This is debated among scholars. Surviving Mesopotamian court records do not show judges citing or applying Hammurabi's code in their rulings, which has led historians such as Marc Van De Mieroop and Norman Yoffee to argue it was not a binding statutory code in the modern sense. Many now view the stele as primarily a symbolic monument projecting Hammurabi as a just king who received his authority from Shamash, the sun god of justice depicted at the top of the stele.
Sources & Further Reading
- Code of Hammurabi — Wikipedia
- Martha T. Roth, Law Collections from Mesopotamia and Asia Minor (Society of Biblical Literature Writings from the Ancient World, 2nd ed., 1997)
- Raymond Westbrook, 'Cuneiform Law Codes and the Origins of Legislation' (Zeitschrift fur Assyriologie, 1989) and A History of Ancient Near Eastern Law (ed., 2003)
- J.J. Finkelstein, 'Ammisaduqa's Edict and the Babylonian Law Codes' (Journal of Cuneiform Studies, 1961) and 'The Ox That Gored' (1981)
- Marc Van De Mieroop, King Hammurabi of Babylon: A Biography (Blackwell, 2005)
- Kathryn E. Slanski, 'The Law of Hammurabi and Its Audience' (Yale Journal of Law & the Humanities, 2012)
- Yale: Translation of the Code