Is being gay legal in Kenya? What the law says on same-sex relations
Kenya Law / Supreme Court of Kenya · sources read 4 Oct 2026
Under the Penal Code, "carnal knowledge against the order of nature" is a felony punishable by up to 14 years in prison, and "gross indecency" between men by up to 5 years. The High Court upheld these sections in 2019. In 2023 the Supreme Court ruled that LGBTQ people still have the right to form and register associations.
- Where
- This is the law, not a service. Questions about a specific case go to a lawyer or the courts.
Steps
- Section 162: anyone who has carnal knowledge of a person "against the order of nature", or allows a man to do so with them, commits a felony with up to 14 years in prison.
- Section 163: attempting any offence in section 162 is a felony with up to 7 years in prison.
- Section 165: a man who commits an act of "gross indecency" with another man, in public or in private, commits a felony with up to 5 years in prison.
- In 2019 the High Court (EG & 7 others v Attorney General) found sections 162(a), 162(c) and 165 not unconstitutional, so they remain law.
- On 24 February 2023 the Supreme Court ruled it unconstitutional to refuse to register an association purely because of its members' sexual orientation.
Watch out
- The 2023 ruling did not change the Penal Code. The Supreme Court said everyone, whatever their orientation, can still be punished under sections 162, 163 and 165.
- The Constitution gives every adult the right to marry a person of the opposite sex. Same-sex marriage is not recognised.
Who this covers
- Everyone in Kenya. Section 162 applies to any person; section 165 applies to men.
Official sources (3)
- Penal Code (Cap. 63), Revised Edition 2014 probation.go.ke · read 4 Oct 2026
- NGOs Co-ordination Board v Eric Gitari & 4 others, SC Petition No. 16 of 2019, Judgment (delivered 24 February 2023) supremecourt.judiciary.go.ke · read 4 Oct 2026
- Constitution of Kenya, 2010 new.kenyalaw.org · read 4 Oct 2026