The First Constitution In The World
The question of what counts as the first constitution is messier than most history books admit. If you ask a trivia database, you get the Constitution of Medina, dated to 622 CE, attributed to the Prophet Muhammad. If you ask a legal historian who is being pedantic, they will point to the Code of Hammurabi or the Code of Ur-Nammu. If you ask someone who means "a governing document for a modern state that is still in force," they will say San Marino, 1600 CE. The answer depends entirely on what you mean by constitution. Most mainstream sources cite the Constitution of Medina (Sahifat al-Madinah) as the first written constitution. It was drafted after Muhammad migrated from Mecca to Yathrib, which later became known as Medina. The document established a political and legal framework uniting the various tribes and religious groups living there — Muslim migrants from Mecca, the Ansar (Medinan supporters), Jewish tribes, and others — under a single community called the ummah, at least for political and defensive purposes. What makes it noteworthy is not that it was democratic or liberal by modern standards, but that it was a written social contract between multiple distinct groups in a polycentric city-state. Before this, the area was fractured between warring tribal factions. The constitution provided shared defense obligations, dispute resolution mechanisms, and recognition of religious autonomy for each group. It was pragmatic, not philosophical.
I have seen this document cited in everything from introductory Islamic studies courses to papers on early pluralist governance. The problem is that people tend to romanticize it or dismiss it depending on their agenda, and neither approach is accurate.
How It Actually Functioned
The constitution was roughly 50 clauses long, though different manuscript traditions vary in length and content. It covered mutual defense, collective response to external threats, internal dispute resolution through arbitration, financial obligations during wartime, and the status of each tribe. Jewish tribes were explicitly recognized as part of the political community alongside Muslims. They had the right to practice their religion and were obligated to contribute to the city's defense. One clause that comes up often states that if someone attacked the residents of Medina, all signatories were obligated to defend them collectively. Another clause established that Muhammad was the final arbitrator in disputes that could not be resolved internally between tribes. This is where the document stops being merely a treaty and becomes something closer to a constitutional framework — a single authority above the factional squabbles. The constitution did not create a modern nation-state. There was no separation of church and state, no bill of rights, no concept of popular sovereignty in the contemporary sense. But it did establish a written framework for coexistence and governance among diverse groups, which is what most people mean when they refer to it as a constitution.
Get the Full Details

Common Misunderstandings
The biggest error people make is treating the Constitution of Medina as equivalent to the United States Constitution. It is not. The US document establishes a federal republic with separated powers, individual rights, and electoral mechanisms. The Constitution of Medina was a tribal-era social compact with a prophetic figure as ultimate arbiter. Comparing them directly is like comparing a zoning ordinance to a novel because both are written documents. A second mistake is assuming the constitution was universally accepted and remained stable. It was not. After the Battle of Badr and subsequent conflicts, several Jewish tribes were expelled or neutralized, and the political reality of Medina shifted significantly. The constitution as originally conceived did not survive those changes intact. Documenting a framework is one thing. Maintaining it under pressure is another. The third misconception involves dating. 622 CE is the Hegira, the migration year that marks the beginning of the Islamic calendar. The constitution was drafted around this time, in the first year after migration. Some scholars place it slightly before or after key events, but the general timeframe is well-established.
Earlier Legal Codes: Why They Do Not Count
People often bring up Hammurabi's Code (circa 1754 BCE) or the Code of Ur-Nammu (circa 2100 BCE) as contenders. These are legal codes, not constitutions. A legal code enumerates crimes and punishments. A constitution establishes the structure of governance, defines the relationship between governing bodies and the governed, and sets out the framework for political organization. Hammurabi's Code told you what happened if you borrowed a bull and it died. It did not establish institutions, branches of government, or a social contract between disparate groups. The same logic applies to ancient Greek law codes, Roman Twelve Tables, and other early legal systems. They are important for legal history. They are not constitutional documents in the sense that the term is used when discussing the First Constitution In The World.
A Practical Note on Sources
If you want to read the actual text, the most accessible English translation is in Muslim Community during the Medinan Period by M.A. Shaban, or in The Collected Inquiries of Islam by various compilers. The original Arabic text exists in classical Islamic sources including the works of Ibn Ishaq and Ibn Hisham. Be aware that the transmission history is complex, and some clauses appear in later compilations that may have been edited or interpolated over time. I once spent an afternoon tracking down discrepancies between three different translations of a single clause regarding the military obligations of the Banu Nawfal tribe. One translator rendered it as a defensive alliance obligation, another as an offensive partnership, and a third as purely symbolic. The Arabic term involved was ambiguous enough that all three readings were defensible. The lesson here is that primary source work on this document requires cross-referencing multiple translations and understanding the linguistic nuances, not just grabbing the first result on a search engine.

Who Gets the Actual Title
There is no single answer that satisfies every scholar. The Constitution of Medina is the most commonly cited First Constitution In The World in academic and general reference contexts. But if you define constitution narrowly as a written document establishing a modern state structure with individual rights and institutional checks, you end up looking much further ahead in history, and the answer becomes far less satisfying. That is just how these things work. The category is imprecise, the sources are incomplete, and every claim comes with caveats.