---
title: "Code of Hammurabi | Ancient Mediterranean"
description: "Code of Hammurabi is a Babylonian law code of 282 laws that shows early written justice, social hierarchy, and Mesopotamian government in Ancient Mediterranean."
canonical: "https://fiveable.me/ancient-mediterranean/key-terms/code-of-hammurabi"
type: "key-term"
subject: "Ancient Mediterranean"
unit: "Unit 2"
---

# Code of Hammurabi | Ancient Mediterranean

## Definition

The Code of Hammurabi is a Babylonian legal collection of 282 laws from around 1754 BC. In Ancient Mediterranean, it shows how early states used written law to manage property, family, trade, and punishment.

## What It Is

The Code of Hammurabi is a Babylonian law code from the Old Babylonian Period, carved on a stele and publicly displayed so people could see the rules that governed daily life. In Ancient Mediterranean history, it is one of the clearest examples of early written law from Mesopotamia.

It is not just a list of crimes and punishments. The code shows how Babylon organized society through law, especially by regulating property, labor, trade, marriage, inheritance, and bodily harm. That means you can read it as both a legal document and a snapshot of how an urban empire tried to keep order.

The laws are often associated with lex talionis, or the principle of retaliation, sometimes summarized as “an eye for an eye.” That does not mean every punishment was identical or simple. The penalties changed depending on social rank, so nobles, commoners, and enslaved people were not treated the same way. That social hierarchy is one of the biggest clues the code gives you about Babylonian values.

The code is also famous for how it presents justice. It is written as if the king is establishing fairness for the land, which turns law into a sign of royal authority. Hammurabi is not just making rules, he is showing that his rule is orderly, divinely sanctioned, and strong enough to unify different groups under one system.

For this course, the code matters because it connects writing, government, and social structure. Mesopotamian civilization did not just invent cuneiform for recordkeeping and literature, it also used it to preserve legal authority. The Code of Hammurabi is one of the best examples of writing becoming a tool of state power, not just communication.

## Why It Matters

The Code of Hammurabi matters because it gives you direct evidence for how Mesopotamian states governed real life. You can use it to explain how early empires moved beyond informal custom and into written rules that could be displayed, copied, and enforced.

It also reveals the social structure of Babylon. The fact that penalties changed by status tells you that “justice” in the ancient world usually meant order, not equality. That distinction comes up a lot in Ancient Mediterranean history, especially when comparing different societies’ ideas about law and citizenship.

The code also connects to writing itself. Cuneiform was not only for myths or records, it was powerful enough to carry legal authority. When you see the code next to other Mesopotamian achievements, it fits into a bigger pattern of city-states and early empires using writing, administration, and public display to control territory and people.

If you are reading about Babylon, Hammurabi, or Mesopotamia, this term gives you a concrete example of how kings used law to strengthen rule and create stability.

## Connections

### Cuneiform

The Code of Hammurabi was written in cuneiform, so this term shows how Mesopotamian writing moved beyond receipts and bookkeeping. When you connect the two, you see writing as a political tool. The law code needed a script that could be carved in stone and read by officials, priests, and elites across the city.

### [Lex Talionis](/ancient-mediterranean/key-terms/lex-talionis)

Lex talionis is the revenge or retaliation principle often linked to Hammurabi’s laws. The connection matters because it helps you notice that punishment in the code is meant to match the offense, but not always equally for everyone. That makes the code feel harsher and more stratified than modern ideas of equal justice.

### Mesopotamia

The Code of Hammurabi comes out of Mesopotamia’s river-valley civilization, where farming surpluses, cities, and trade created new legal problems. This connection helps you see why law became necessary. Once people owned land, hired labor, and traded goods, rulers needed public rules to settle disputes and protect order.

### [Old Babylonian Period](/ancient-mediterranean/key-terms/old-babylonian-period)

Hammurabi belongs to the Old Babylonian Period, when Babylon became a major power. That context matters because the code is not just a random law list, it is part of a state-building project. The laws help show how Babylon organized conquered and diverse populations under a single political system.

## On the AP Exam

A quiz question might ask you to identify the Code of Hammurabi from a description of a stone stele, written laws, or unequal punishments. In a short answer or essay, you might use it as evidence that Mesopotamian rulers used writing to reinforce political authority and social hierarchy. If you get a comparison prompt, this term is useful for showing how legal systems can reveal a society’s values, not just its rules. When you see a source excerpt, look for what kind of behavior it regulates, who gets punished more harshly, and what that says about power in Babylon.

## Code of Hammurabi vs Lex Talionis

These are related, but not the same. Lex talionis is the principle of retaliation, while the Code of Hammurabi is the full Babylonian law collection that includes that principle along with many other rules about family, property, labor, and trade. If a question asks for the whole legal text, choose Hammurabi. If it asks about the punishment principle, choose lex talionis.

## Key Takeaways

- The Code of Hammurabi is a Babylonian law code from around 1754 BC, and it is one of the clearest examples of early written law in Mesopotamia.
- It covers daily life, including trade, family, labor, property, and punishment, so it shows how law shaped an entire city-state society.
- The code reflects social hierarchy because penalties changed based on status, which tells you ancient justice was not equal in the modern sense.
- Its public display on a stele shows that rulers wanted laws to be seen as official, permanent, and tied to royal authority.
- In Ancient Mediterranean history, it is a major example of how writing, government, and social order developed together.

## FAQs

### What is the Code of Hammurabi in Ancient Mediterranean?

It is a Babylonian legal text of 282 laws from the Old Babylonian Period. In Ancient Mediterranean history, it shows how one of the earliest states used written law to regulate society, protect property, and enforce hierarchy.

### Is the Code of Hammurabi the same as lex talionis?

No. Lex talionis is the idea of punishment matching the offense, often called retaliation or retribution. The Code of Hammurabi is the larger law code that includes that idea in some laws, but it also covers many other topics like trade, family, and labor.

### Why was the Code of Hammurabi carved on a stele?

A stele made the laws public and permanent. That mattered because the king wanted the code to look official and visible, not secret or temporary. The display also turned law into a statement of royal power.

### What does the Code of Hammurabi show about Babylonian society?

It shows that Babylon was hierarchical, urban, and organized around property and authority. The laws reveal that nobles, commoners, and enslaved people did not receive the same treatment, which is a major clue about social structure in Mesopotamia.

## Related Study Guides

- [2.1 Mesopotamian city-states and early empires](/ancient-mediterranean/unit-2/mesopotamian-city-states-early-empires/study-guide/6JAma5tun1Low6yg)
- [2.2 Development of writing and early literature](/ancient-mediterranean/unit-2/development-writing-early-literature/study-guide/d19WxV3LcVlUmPvX)

## About This Document

Canonical Fiveable pages are available as Markdown at the same path plus `.md`.

- [llms.txt](https://fiveable.me/llms.txt): index of Fiveable's sections and URL patterns
- [llms-full.txt](https://fiveable.me/llms-full.txt): complete subject and unit listing
- [MCP server](https://fiveable.me/mcp): call Fiveable as tools instead of fetching pages (`https://fiveable.me/api/mcp`)
- [MCP server for AP teachers](https://fiveable.me/mcp/teachers): a teacher's classes, assignments and AP-rubric grading (`https://fiveable.me/api/mcp/teacher`)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ancient-mediterranean/key-terms/code-of-hammurabi#resource","name":"Code of Hammurabi | Ancient Mediterranean","url":"https://fiveable.me/ancient-mediterranean/key-terms/code-of-hammurabi","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ancient-mediterranean/key-terms/code-of-hammurabi#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-07-03T02:21:02.382Z","isPartOf":{"@type":"Collection","name":"Ancient Mediterranean Key Terms","url":"https://fiveable.me/ancient-mediterranean/key-terms"},"publisher":{"@type":"Organization","name":"Fiveable","url":"https://fiveable.me"}},{"@type":"DefinedTerm","@id":"https://fiveable.me/ancient-mediterranean/key-terms/code-of-hammurabi#term","name":"Code of Hammurabi","description":"The Code of Hammurabi is a Babylonian legal collection of 282 laws from around 1754 BC. In Ancient Mediterranean, it shows how early states used written law to manage property, family, trade, and punishment.","url":"https://fiveable.me/ancient-mediterranean/key-terms/code-of-hammurabi","inDefinedTermSet":{"@type":"DefinedTermSet","name":"Ancient Mediterranean Key Terms","url":"https://fiveable.me/ancient-mediterranean/key-terms"}},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the Code of Hammurabi in Ancient Mediterranean?","acceptedAnswer":{"@type":"Answer","text":"It is a Babylonian legal text of 282 laws from the Old Babylonian Period. In Ancient Mediterranean history, it shows how one of the earliest states used written law to regulate society, protect property, and enforce hierarchy."}},{"@type":"Question","name":"Is the Code of Hammurabi the same as lex talionis?","acceptedAnswer":{"@type":"Answer","text":"No. Lex talionis is the idea of punishment matching the offense, often called retaliation or retribution. The Code of Hammurabi is the larger law code that includes that idea in some laws, but it also covers many other topics like trade, family, and labor."}},{"@type":"Question","name":"Why was the Code of Hammurabi carved on a stele?","acceptedAnswer":{"@type":"Answer","text":"A stele made the laws public and permanent. That mattered because the king wanted the code to look official and visible, not secret or temporary. The display also turned law into a statement of royal power."}},{"@type":"Question","name":"What does the Code of Hammurabi show about Babylonian society?","acceptedAnswer":{"@type":"Answer","text":"It shows that Babylon was hierarchical, urban, and organized around property and authority. The laws reveal that nobles, commoners, and enslaved people did not receive the same treatment, which is a major clue about social structure in Mesopotamia."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Ancient Mediterranean","item":"https://fiveable.me/ancient-mediterranean"},{"@type":"ListItem","position":2,"name":"Key Terms","item":"https://fiveable.me/ancient-mediterranean/key-terms"},{"@type":"ListItem","position":3,"name":"Unit 2","item":"https://fiveable.me/ancient-mediterranean/unit-2"},{"@type":"ListItem","position":4,"name":"Code of Hammurabi"}]}]}
```
