Slave codes
The slave codes were laws relating to slavery and enslaved people, specifically regarding the Atlantic slave trade and chattel slavery in the Americas. Most slave codes were concerned with the rights and duties of free people in regards to enslaved people. Slave codes left a great deal unsaid, with much of the actual practice of slavery being a matter of traditions rather than formal law. The primary colonial powers all had slightly different slave codes. French colonies, after 1685, had the Code Noir specifically for this purpose. The Spanish had some laws regarding slavery in Las Siete Partidas, a far older law that was not designed for the slave societies of the Americas. English colonies largely had their own local slave codes, mostly based on the codes of either the colonies of Barbados or Virginia. In addition to these national and state- or colony-level slave codes, there were city ordinances and other local restrictions regarding enslaved people. Typical slave codes
There are many similarities between the various slave codes. The most common elements are:

Movement restrictions: Most regions required any slaves away from their plantations or outside of the cities they resided in to have a pass signed by their master. Many cities in the slave-states required slave tags, small copper badges that enslaved people wore, to show that they were allowed to move about. Marriage restrictions: Most places restricted the marriage rights of enslaved people, ostensibly to prevent them from trying to change masters by marrying into a family on another plantation. Marriage between people of different races was also usually restricted. Prohibitions on gathering: Slave codes generally prevented large groups of enslaved people from gathering away from their plantations. Slave patrols: In the slave-dependent portions of North America, varying degrees of legal authority backed slave patrols by plantation owners and other free whites to ensure that enslaved people were not free to move about at night, and to generally enforce the restrictions on slaves. Trade and commerce by slaves: Initially, most places gave enslaved people some land to work personally and allowed them to operate their markets. As slavery became more profitable, slave codes restricting the rights of enslaved people to buy, sell, and produce goods were introduced. In some places, slave tags were required to be worn by enslaved people to prove that they were allowed to participate in certain types of work. Punishment and killing of slaves: Slave codes regulated how slaves could be punished, usually going so far as to apply no penalty for accidentally killing a slave while punishing them. Later laws began to apply restrictions on this, but slave-owners were still rarely punished for killing their slaves. Historian Lawrence M. Friedman wrote: "Ten Southern codes made it a crime to mistreat a slave.... Under the Louisiana Civil Code of 1825 (art. 192), if a master was ′convicted of cruel treatment,′ the judge could order the sale of the mistreated slave, presumably to a better master." Education restrictions: Some codes made it illegal to teach slaves to read. Slave literacy

England's American colonies and the United States
There was no central English slave code; each colony developed its own code, often with reference to Roman law and its treatment of the  status of slaves. After the United States established independence in the American Revolutionary War of 1775-1783, the individual states ratified new constitutions, but their laws were generally a continuation of the laws those regions had maintained prior to that point, and their slave codes remaining unchanged. The first comprehensive slave-code in an English colony was established in Barbados, an island in the Caribbean, in 1661. Many other slave codes of the time are based directly on this model. Modifications of the Barbadian slave codes were put in place in the Colony of Jamaica in 1664, and were then greatly modified in 1684. The Jamaican codes of 1684 were copied by the  colony of South Carolina in 1691. The South Carolina slave-code served as the model for many other colonies in North America. In 1755, the colony of Georgia adopted the South Carolina slave code. Virginia's slave codes were made in parallel to those in Barbados, with individual laws starting in 1667 and a comprehensive slave-code passed in 1705. In 1667, the Virginia House of Burgesses enacted a law which didn't recognize the conversion of African Americans to Christianity despite a baptism. In 1669, Virginia enacted "An act about the casual killing of slaves" which declared that masters who killed slaves deemed resisting were exempt from felony charges. In 1670, they enacted a law prohibiting free Africans from purchasing servants who weren't also African. In 1680, Virginia passed Act X, which prohibited slaves from carrying weapons, leaving their owner's plantation without a certificate, or raising a hand against "Christians". The slave codes of the other tobacco colonies (Delaware,  Maryland, and North Carolina) were modeled on the Virginia code. While not based directly on the codes of Barbados, the Virginia codes were inspired by them. The shipping and trade that took place between the West Indies and the Chesapeake (the "final passage" of the Triangular Trade) meant that planters quickly became aware of any legal and cultural changes that took place. According to historian Russell Menard, when Maryland put its slave code in place in the 1660s the Barbadian codes functioned as a "legal cultural hearth" for the law, with members of the Maryland legislature having been former residents of Barbados. The northern colonies developed their own slave-codes at later dates, with the strictest evolving in the  colony of New York, which passed a comprehensive slave code in 1702 and expanded that code in 1712 and 1730. The British Slave Trade Act 1807 abolished the  slave trade throughout the British Empire. In 1833, the  Slavery Abolition Act ended slavery throughout the British Empire. The  United States experienced divisions between slave states in the South and free states in the North. At the start of the American Civil War in 1861, there were 34 states in the United States, 15 of which were slave states, all of which had slave codes. The 19 free states did not have slave codes, although they still had laws regarding slavery and enslaved people, covering such issues as how to handle slaves from slave states, whether they were runaways or with their owners. Slavery was not banned nationwide in the United States until the  Thirteenth Amendment was ratified by 27 states by December 6, 1865. The 1807 Act Prohibiting Importation of Slaves, in effect on 1 January 1808, had made it a felony to import slaves from abroad. French slave codes
The French colonies in North America  were the only portion of the Americas to have an effective slave code applied from the center of the empire. King Louis XIV applied the Code Noir in 1685, and it was adopted by Saint-Domingue in 1687 and the French West Indies in 1687, French Guiana in 1704, Réunion in 1723, and Louisiana in 1724. It was never applied in Canada, which had very few slaves. The Code Noir was developed in part to combat the spread of Protestantism and thus focuses more on religious restrictions than other slave codes. The Code Noir was significantly updated in 1724. The city of New Orleans in Louisiana developed slave codes under Spain, France, and the United States, due to Louisiana changing hands several times, resulting in a very complex set of slave codes. The needs of the locals were usually held in favor over any outside laws. France abolished slavery after the French Revolution, first by freeing second-generation slaves in 1794. Although it was reinstated under Napoleon with the law of 20 May 1802. Spanish slave codes
In practice, the slave codes of the Spanish colonies were local laws, similar to those in other regions. There was an overarching legal code, Las Siete Partidas, which granted many specific rights to the slaves in these regions, but there is little record of it actually being used to benefit the slaves in the Americas. Las Siete Partidas was compiled in the thirteenth century, long before the colonization of the new world, and its treatment of slavery was based on the Roman tradition. Frank Tannenbaum, an influential sociologist who wrote on the treatment of slaves in the Americas, treated the laws in Las Siete Partidas as an accurate reflection of treatment, but later scholarship has moved away from this viewpoint, arguing that the official laws in Las Siete Partidas did not reflect practices in the colonies. An attempt to unify the Spanish slave codes, the Codigo Negro, was cancelled without ever going into effect because it was unpopular with the slave-owners in the Americas. The Laws of the Indies were an ongoing body of laws, modified throughout the history of the Spanish colonies, that incorporated many slave laws in the later versions. Other slave codes
 Barbados slave codes
 Code Noir; French black code
 New York slave codes
 South Carolina slave codes
 Virginia slave codes of 1705

See also

 Anti-literacy laws in the United States
 Atlantic slave trade
 Black Codes
 Convict leasing
 Coolie
 Debt bondage
Education after Slavery
 Forced labour
 Human trafficking
 Indentured servitude
 International Year to Commemorate the Struggle against Slavery and its Abolition
Ohio Black Codes
 Slave narrative
 Slave rebellion
 Slave Trade Act
 Slavery in Africa
 Slavery in Canada
 Slavery in the colonial United States
 Slavery in the United States
 Origins of the American Civil War
 North Carolina v. Mann

Notes

References
 Christian, Charles M., and Bennet, Sari, Black saga: the African American experience : a chronology,  Basic Civitas Books, 1998
 Thomas Cooper and David J. McCord, ed., Statutes at Large of South Carolina, (10 Vols., Columbia, 1836–1841) VII, pp. 352–356. B. F. French, Historical Collections of Louisiana:Embracing Translations of Many Rare and Valuable Documents Relating to the Natural, Civil, and Political History of that State (New York: D. Appleton, 1851)
 Slave Code for the District of Columbia
  Laws of the State of Alabama, 1833

Further reading
 Goodell, William (1853). The American Slave Code in Theory and Practice: Its Distinctive Features Shown by Its Statutes, Judicial Decisions, and Illustrative Face

 Virginia's slave codes on PBS.org
 Slave codes of District of Columbia
 Slave codes of State of Georgia
 The American Slave Code in Theory and Practice: Its Distinctive Features Shown by Its Statutes, Judicial Decisions, and Illustrative Face
Law in the Southern Colonies

United States slavery law
Slavery in North America
Slavery in the British Empire
Slavery law