Is It Illegal to Be Gay in Kenya? Penal Code and Penalties

Being gay is not, by itself, a crime in Kenya, but same-sex sexual conduct between men is. Sections 162 and 165 of the Penal Code criminalize “carnal knowledge against the order of nature” and “gross indecency” between males, with maximum penalties of 14 and 5 years in prison respectively. So the honest answer to whether it is illegal to be gay in Kenya is this: the law targets specific acts rather than identity or attraction, but the acts it targets are closely tied to how many gay men live their lives, and the laws are routinely used as leverage for police harassment even when no one is prosecuted.

What the Penal Code Criminalizes

Two provisions do the work. Section 162 makes it a felony for any person to have “carnal knowledge against the order of nature,” which Kenyan courts have read to mean anal sex. A conviction carries up to 14 years. An attempt carries up to seven.1GOV.UK. Country Policy and Information Note: Sexual Orientation and Gender Identity and Expression, Kenya

Section 165 criminalizes “gross indecency” between males, in public or private, with a maximum of five years. It applies only to men.2Immigration and Refugee Board of Canada. Kenya: Situation of Persons with Diverse Sexual Orientation and Gender Identity and Expression

The wording matters. Section 162 says “any person” and is technically gender-neutral. Section 165 is limited to men. Sexual conduct between women is not explicitly criminalized under either provision, and in practice enforcement falls almost entirely on men and transgender women.

The laws reach conduct, not identity. No one can be charged for how they identify or who they are attracted to; the criminal provisions attach to specific acts. That distinction offers limited practical comfort when the laws are used as tools of social control, but it is the actual legal line.

What Enforcement Looks Like in Practice

Formal prosecutions under Sections 162 and 165 are rare. The U.K. government’s 2025 country assessment concluded that “the state does not actively enforce the anti-LGBT laws and prosecutions are rare,” and Kenyan organizations have reported that no major case has gone through the full court process under these provisions in recent years.1GOV.UK. Country Policy and Information Note: Sexual Orientation and Gender Identity and Expression, Kenya

The harm happens outside the courtroom. Police use the provisions as leverage for extortion and intimidation. The National Gay and Lesbian Human Rights Commission documented 679 cases of blackmail and extortion between 2014 and 2022, with anecdotal evidence suggesting thousands more go unreported. In some documented instances, undercover officers used dating apps to lure LGBTQ+ individuals specifically to extort them.1GOV.UK. Country Policy and Information Note: Sexual Orientation and Gender Identity and Expression, Kenya

When police do make arrests, they often charge LGBTQ+ individuals under general public-order offenses such as loitering or disturbing the peace rather than under the sodomy provisions themselves. People are frequently detained without charge and released after paying bribes. The threat of Section 162 or 165 shapes the encounter even when the eventual charge is something else.2Immigration and Refugee Board of Canada. Kenya: Situation of Persons with Diverse Sexual Orientation and Gender Identity and Expression

Why the Laws Are Still on the Books

Activists filed petitions in 2016 asking the High Court to strike down Sections 162 and 165 as unconstitutional, arguing the provisions violated the 2010 Constitution’s protections of privacy, dignity, and equality. On May 24, 2019, a three-judge panel unanimously upheld the laws.

The court said the provisions were not discriminatory on their face because Section 162 applies to “any person” and Section 165 to “any male person” rather than naming LGBTQ+ individuals. More consequentially, it tied criminalization to Article 45 of the Constitution, which states that “every adult has the right to marry a person of the opposite sex.”3Kenya Law Reform Commission. Constitution of Kenya – 45. Family The judges reasoned that decriminalizing same-sex conduct would lead to same-sex couples living together, which they viewed as conflicting with the constitutional definition of family. They rejected the argument that private conduct could be separated from marriage, and concluded petitioners had not shown discrimination severe enough to outweigh the state’s interest in what the court called traditional morality.

Where Courts Have Pushed Back

Two rulings have carved out protections even while the sodomy laws remain intact.

In March 2018, the Kenya Court of Appeal held that forced anal examinations are unconstitutional, finding the procedures violate the rights to privacy and dignity. The ruling reversed a 2016 High Court decision that had permitted the practice, and affirmed that constitutional protections apply regardless of sexual orientation or gender identity.1GOV.UK. Country Policy and Information Note: Sexual Orientation and Gender Identity and Expression, Kenya

In February 2023, the Supreme Court ruled 3-to-2 that the NGO Coordination Board could not deny registration to the National Gay and Lesbian Human Rights Commission based on the sexual orientation of its members. The majority found the denial violated Article 36 of the Constitution, which guarantees freedom of association.4Supreme Court of Kenya. Petition No. 16 of 2019 – NGOs Co-ordination Board vs Eric Gitari and 5 Others5National Council for Law Reporting. The Constitution of Kenya, 2010 The court reaffirmed the ruling in September 2023 after a challenge from an MP. LGBTQ+ advocacy organizations can now legally register and operate in Kenya, even though the acts they advocate decriminalizing remain criminal.

No Anti-Discrimination Protections

Kenya’s statutes offer no explicit protection against discrimination based on sexual orientation. The Employment Act of 2007 prohibits workplace discrimination on grounds of race, sex, religion, political opinion, nationality, ethnic origin, disability, pregnancy, and HIV status. Sexual orientation is not on that list.6Kenya Law. The Employment Act, 2007

The Constitution guarantees adequate housing under Article 43, and some advocates argue this implicitly bars eviction based on sexual orientation. No court has tested that argument, and no specific statute prevents a landlord from refusing to rent to an LGBTQ+ tenant. Same-sex marriage performed abroad has no legal standing in Kenya under Article 45.

A Bill That Would Have Gone Much Further

In 2023, MP George Peter Kaluma introduced the Family Protection Bill, which proposed sharply harsher penalties for same-sex conduct and, for the first time, targeted advocacy and funding. The bill would have imposed a minimum 10-year sentence for anyone promoting activities prohibited under the act, with the same minimum for individuals or organizations funding such activities. Fines ranged from one million to ten million Kenyan shillings. Certain provisions could have imposed the death penalty for some same-sex conduct and prison time for property owners whose premises were used for prohibited activities.7Parliament of Kenya. The Family Protection Bill, 20231GOV.UK. Country Policy and Information Note: Sexual Orientation and Gender Identity and Expression, Kenya

The bill never became law. It lapsed at the end of the Third Session in 2024 under Standing Order 141(2), which automatically kills bills that have not progressed through the required legislative stages within a parliamentary session.8Parliament of Kenya. Bills Tracker as at Friday, 13th February 2026 A similar bill could be reintroduced in a future session. As of early 2026, Sections 162 and 165 remain the only active criminal provisions.

What Foreign Visitors Should Know

The Penal Code applies to everyone physically present in Kenya, regardless of citizenship or residency. A foreign national faces the same 14-year or 5-year maximum sentences as a Kenyan citizen under Sections 162 or 165.2Immigration and Refugee Board of Canada. Kenya: Situation of Persons with Diverse Sexual Orientation and Gender Identity and Expression

Prosecutions of tourists are extremely uncommon, and the broader pattern of rare formal charges applies to visitors as well. The realistic risk for travelers is the same one Kenyans face: police encounters that end in extortion or detention rather than formal prosecution. Public displays of affection between same-sex partners can attract hostile attention from law enforcement and from bystanders.