Yes, being gay is illegal in Iran. The Islamic Penal Code criminalizes every form of sexual intimacy between people of the same sex, and penalties range from 100 lashes to execution depending on the act, the roles of those involved, and in some cases their religion. Enforcement is active: authorities monitor dating apps, run entrapment operations, and prosecute cases using confessions obtained under torture. Beyond the courts, LGBTQ Iranians face family violence, workplace discrimination with no legal remedy, and a social climate in which more than 90 percent of the population considers homosexuality unjustifiable.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
What the Law Criminalizes
Iran’s Islamic Penal Code of 2013 treats same-sex conduct between men as two separate offenses. Article 233 covers penetrative intercourse. Article 235 covers non-penetrative contact, such as placing genitals between another man’s thighs or buttocks. Article 237 sweeps in other homosexual acts between men that fall outside those two categories. Sexual contact between women is criminalized under Article 238, which addresses genital-to-genital contact between female parties.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
Consent is irrelevant. Privacy is irrelevant. The law applies to every person inside Iran’s borders regardless of citizenship, religion, or belief, and it covers acts that would be considered minor intimacy in most other countries.
Penalties
For penetrative intercourse between men, the receptive partner faces execution in every case, regardless of marital status. The insertive partner faces execution if he used force or qualifies as “married” under the code. An unmarried insertive partner who did not use force receives 100 lashes. A separate rule imposes mandatory execution on any non-Muslim insertive partner whose receptive partner is Muslim, regardless of other circumstances.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
For non-penetrative contact between men, both parties receive 100 lashes. Marital status and consent do not change the sentence. The same religious escalation applies: a non-Muslim insertive partner with a Muslim receptive partner faces execution.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
Sexual contact between women carries 100 lashes for each party. The code does not distinguish by role or marital status.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
All of these are classified as “hadd” offenses, meaning the punishments are treated as fixed by religious law and judges have limited discretion to reduce them. Article 136 adds a blanket rule that converts repeated lashings into a death sentence: anyone convicted and punished for a hadd offense three times faces execution on the fourth conviction. A person repeatedly convicted of non-penetrative male contact or same-sex contact between women, offenses that normally carry 100 lashes, can therefore end up executed.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
How Cases Are Actually Proven
On paper, the evidentiary bar is high. Article 199 requires four male witnesses who personally observed the act. Article 200 warns that witnesses who testify without having seen the conduct, or where the required number is not met, face punishment themselves for false accusation. A confession can substitute for witnesses, but Article 172 requires it to be repeated four separate times. Article 173 offers one additional safeguard: a defendant who confesses and then recants cannot be executed and instead receives 100 lashes.1United Nations Office on Drugs and Crime. Islamic Penal Code of the Islamic Republic of Iran
In practice these protections frequently collapse. Human rights observers have documented convictions based on pre-trial statements made under torture, confessions later recanted, testimony from fewer than four witnesses, and cases where the accused had no lawyer and did not understand the charges. Courts sometimes bypass the evidentiary requirements altogether by charging defendants with “corruption on earth,” a vague offense that carries the death penalty without the same proof threshold. In 2022, two women, including LGBT activist Zahra Sedighi-Hamadani, were sentenced to death by an Islamic Revolution Court on exactly that charge.2Office of the United Nations High Commissioner for Human Rights. Iran: UN Experts Demand Stay of Execution for Two Women, Including LGBT Activist
Surveillance and Online Entrapment
Most prosecutions do not begin with four witnesses in a bedroom. They begin on a phone. Iranian security forces actively monitor dating apps and social platforms used by LGBTQ Iranians, including Grindr, Hornet, Telegram, and WhatsApp. Officers infiltrate online queer spaces, sometimes posing as potential partners to collect identifying information that is later used to make arrests. Administrators of LGBTQ-focused Telegram groups have been arrested after authorities monitored those channels.
Chat logs, photos, and app usage history have been used as evidence to support prosecutions, often framed as proof of “immoral” conduct or “corruption on earth.” People detained in these operations are frequently pressured during interrogation to name and locate other LGBTQ people, so a single arrest can lead to a wider sweep. LGBTQ Iranians rely heavily on VPNs and encrypted messaging to maintain some privacy; bills under consideration in Iran’s parliament would criminalize VPN use and ban international encrypted services, which would remove those remaining safeguards.
Life Outside the Courtroom
Iran has no legal protection against discrimination based on sexual orientation or gender identity. An employer can fire someone for being gay. A landlord can refuse to rent. There is no agency to complain to and no civil remedy. Most LGBTQ Iranians live double lives, keeping a public heterosexual persona and confining their real identity to trusted people and underground networks.
Family rejection is common and sometimes violent. So-called “honor” killings of LGBTQ family members have been documented, and the state rarely treats them as the serious crimes they are. Survey data from the World Values Survey found that more than 90 percent of Iranian respondents said homosexuality is never justifiable, which is the social backdrop any disclosure runs into.
Medical treatment is not a refuge. Human rights reports describe practitioners labeling homosexuality as a mood disorder or obsessive-compulsive condition and prescribing antipsychotic drugs. Conversion practices, including behavioral conditioning and electroshock, have been documented. The state does not prohibit any of this.
During the 2022–2023 nationwide protests, LGBTQ participants were disproportionately targeted by security forces. Documented abuses included gender-based violence, sexual assault during detention, and aggravated charges tied to perceived sexual orientation or gender identity.
The Transgender Exception and the Pressure It Creates
Iran draws a sharp line between sexual orientation and gender identity. Same-sex attraction is criminalized, but legal gender transition is permitted and partly subsidized. The state treats gender dysphoria as a medical condition with a surgical remedy; once surgery is complete, a person can obtain new legal documents and marry someone of the opposite legal sex.
That split has become coercive for gay Iranians. Because homosexuality is a capital offense and transition is state-sanctioned, gay men and lesbians face pressure to undergo irreversible surgery as a supposed cure. Psychologists at state-run clinics have reported being instructed to tell gay patients they are “sick” and need gender reassignment. Some estimates suggest nearly half of those who undergo the surgery in Iran are not transgender but gay, pushed into a permanent physical change because the alternative is prosecution. Legal recognition is also narrow: there is no path for people who are nonbinary or who wish to live as a different gender without surgery, and gender nonconformity in dress or behavior outside the approved medical pathway can bring fines, lashes, or imprisonment under provisions against indecency.