The Ottoman Empire was governed by different sets of laws during its existence. The Kanun a secular legal system, co-existed with religious law or Sharia. Legal administration in the Ottoman Empire was part of a larger scheme of balancing central and local authority. Ottoman power revolved crucially around the administration of the rights to land, which gave a space for the local authority develop the needs of the local millet. The jurisdictional complexity of the Ottoman Empire was aimed to permit the integration of culturally and religiously different groups.
The Ottoman system had three court systems: one for Muslims, one for non-Muslims, involving appointed Jews and Christians ruling over their respective religious communities, and the "trade court". The entire system was regulated from above by means of the administrative Kanun, i.e. laws, a system based upon the Turkic Yassa and Töre, which were developed in the pre-Islamic era.
These court categories were not, however, wholly exclusive: for instance, the Islamic courts—which were the Empire's primary courts—could also be used to settle a trade conflict or disputes between litigants of differing religions, and Jews and Christians often went to them to obtain a more forceful ruling on an issue. The Ottoman state tended not to interfere with non-Muslim religious law systems, despite legally having a voice to do so through local governors.
The Islamic Sharia law system had been developed from a combination of the Qur'an; the Hadīth, or words of the prophet Muhammad; ijmā', or consensus of the members of the Muslim community; qiyas, a system of analogical reasoning from earlier precedents; and local customs. Both systems were taught at the Empire's law schools, which were in Istanbul and Bursa.
The Ottoman Islamic legal system was set up differently from traditional European courts. Presiding over Islamic courts would be a Qadi, or judge. Since the closing of the itjihad, or Gate of Interpretation, Qadis throughout the Ottoman Empire focused less on legal precedent, and more with local customs and traditions in the areas that they administered.  However, the Ottoman court system lacked an appellate structure, leading to jurisdictional case strategies where plaintiffs could take their disputes from one court system to another until they achieved a ruling that was in their favor.
Throughout the 19th century, the Ottoman Empire adhered to the use of three different codes of criminal law. The first was introduced in 1840, directly following the Edict of Gulhane, an event which started the period of the Tanzimat reforms. In 1851, a second code was introduced. In this one, the laws were nearly the same as the ones in the first code of laws, but included the rulings of the previous eleven years. In 1959, the Ottoman Empire promulgated a last code of law inspired by the 1810 Napoleonic criminal code. Each of these variations of code and legislations represented a new phase in Ottoman legal ideology. 
The Kanun was a secular legal system, used along with religious law. Its use originates from the difficulty to address certain matters (such as taxation, administration, financial matters, or penal law) by Sharia alone, which led the Ottoman rulers to use the Kanun to supplement, and sometimes supplant, religious law. It also offered a way to overcome the problems posed by the extent to which Sharia depended on the interpretation of sources by the ulema, which had made legal standardisation problematic.
The Ottoman Kanun first began to be codified towards the end of the 15th century, after the fall of Constantinople in 1453. The expansion of the empire led to a desire to centralise decisions, and the Kanun allowed the sultan to become an unchallenged ruler, by granting him the power he needed to exercise his authority to the full.
The early Kanun-name (literally: "book of law") were related to financial and fiscal matters, and based on custom (örf), they tried to reconcile previously existing practices with the priorities and needs of the Ottoman state. Kanun-names were also granted to individual provinces following their conquest; these provincial books of law would typically maintain most of the taxes and dues existing under the previous rule, and simply adapt them to an Ottoman standard.
The use of Kanun redefined Ottoman society in a two-tiered hierarchy, with the askeri (or military) consisting of a tax-exempt ruling class which included the "men of the sword," the "men of the book," and the "men of the pen", while the rest of the population, labeled as the reaya ("flock") was at the bottom, with the duty to produce and pay taxes.
One example of Kanun was the "law of fratricide", which required the new sultan to kill all his brothers upon ascending the throne, and had been enacted for fear of a repetition of the fratricidal conflicts that had plagued early successions.
In the late 19th century, the Ottoman legal system saw substantial reform. This process of legal modernization began with the Edict of Gülhane of 1839. These reforms included the “fair and public trial[s] of all accused regardless of religion,” the creation of a system of “separate competences, religious and civil,” and the validation of testimony on non-Muslims. Specific land codes (1858), civil codes (1869-1876), and a code of civil procedure also were enacted.
These reforms were based heavily on French models, as indicated by the adoption of a three-tiered court system. Referred to as Nizamiye, this system was extended to the local magistrate level with the final promulgation of the Mecelle, a civil code that regulated marriage, divorce, alimony, will, and other matters of personal status. In an attempt to clarify the division of judicial competences, an administrative council laid down that religious matters were to be handled by religious courts, and statute matters were to be handled by the Nizamiye courts.
- "Balancing Sharia: The Ottoman Kanun". BBC. Retrieved 5 October 2013.
- Benton, Lauren (3 December 2001). Law and Colonial Cultures: Legal Regimes in World History, 1400-1900. Cambridge University Press. pp. 109–110. ISBN 978-0-521-00926-3. Retrieved 11 February 2013.
- Benton, Laura A.; Law and Colonial Cultures: Legal Regimes in World History, 1400-1900.
- Miller, Ruth A. "Apostates and Bandits: Religious and Secular Interaction in the Administration of Late Ottoman Criminal Law." Studia Islamica 97 (2003): 155-78. JSTOR. Web. <http://www.jstor.org.proxy.lib.fsu.edu/stable/4150605?&Search=yes&sea
- Selçuk Akşin Somel. "Review of "Ottoman Nizamiye Courts. Law and Modernity"". Sabancı Üniversitesi. p. 2.
- Lee Epstein, Karen O’Connor, Diana Grub. "Middle East". Legal Traditions and Systems: an International Handbook. Greenwood Press. pp. 223–224.