The Ottoman Empire, which existed from the 14th century until the early 20th century, had a complex and varied approach to issues related to sexuality and gender, including those of gender and sexual minorities.
Concepts such as gay, lesbian or transgender did not exist in the Ottoman era. Homosexuality was de jure governed by a blend of Qanun (sultanic law) and Islamic religious laws, which translated to negative legalistic perspectives, but also lenient-to-nonexistent enforcement. Therefore, negative perspectives often did not lead to legal sanctions, with rare exceptions. Public norms exhibited fluid gender expressions (particularly for younger males), and attitudes toward same-sex relationships were diverse, often categorized by age and expected roles. Literature and art flourished as significant mediums for discussing gender and sexuality, with Ottoman poets openly exploring same-sex love in the arts until the 19th century, when Westernization led to the stigmatization of homosexuality, potentially influencing the censorship of certain literary scenes.
The 19th-century ushered in transformative changes marked by Westernization; these changes largely stigmatized homosexuality. The 1858 Ottoman Penal Code is a pivotal moment, often cited as signaling private decriminalization. However, previous laws against homosexuality were rarely invoked by the Ottomans, and this liberalization came amid heightening heteronormativity and anxieties about open same-sex expression among men, leading many scholars to question the validity of the "decriminalization" paradigm used for the Ottoman Empire.
Beyond its borders, the perception of homosexuality in the Ottoman Empire became entwined with Orientalist tropes, perpetuating stereotypes of sexual perversion in Western discourse. This representation reflected attempts to assert the moral superiority of Christendom over the Muslim world.