Compare LGBT Rights in Morocco, China, Namibia, & Libya

Equality Index

Overall score, and how far each country’s laws sit from its public opinion

  • Legal
  • Public opinion
  • Equality Index
Country · Equality Index
Legal ↔ Public opinion
Gap
56
ChinaRank 1 of 4
4766
19 ptsOpinion ahead of laws
42
NamibiaRank 2 of 4
5133
18 ptsLaws ahead of opinion
13
MoroccoRank 3 of 4
1215
3 ptsOpinion ahead of laws
13
LibyaRank 3 of 4
819
11 ptsOpinion ahead of laws
0255075100

Compared with every country

  • In this comparison
  • Other countries
25
50
75
100
China56
Namibia42
Morocco13
Libya13
Highest197 countries, ranked by Equality IndexLowest

Law

Current legal status of LGBTQ+ rights in each country

  • Protected
  • Restricted
  • Not protected
Issue
Morocco
China
Namibia
Libya
Homosexual activity Illegal (imprisonment as punishment)
Since 1962
Article 489 of the Penal Code punishes same sex behaviour by imprisonment of between 6 months and 3 years, and a fine of 200 to 1000…
Legal
Since 1997
China’s current Penal Code (1997) contains no explicit prohibition of consensual sexual acts between persons of the same sex and all…
Legal
Since 2024
In 2024, a Namibian High Court ruled that certain Namibian laws that criminalized sodomy were unconstitutional. The laws had been in place…
Illegal (imprisonment as punishment)
Since 1953
Articles 407 and 408 of the Penal Code of 1953 criminalize homosexuality. Article 407 criminalizes “illicit sexual intercourse” with up to…
Same-sex marriage Banned
Since 1958
Article 1 of the 1958 Moroccan Personal Status Code (alternatively called the Moroccan Family Code or Moudawana) defined marriage as a…
Other type of partnership
Since 2017
Since October 1st, 2017, a system has been available for all adult citizens called “guardianship appointment”. The system grants couples…
Foreign same-sex marriages recognized only
Since 2023
In 2023, Namibia’s top court ruled that Namibia must recognize same-sex marriages performed in other countries. On December 30th, 2024, the…
Banned
In Libya, marriage is defined as between a man and a woman, and same-sex couples are granted no legal recognition.
Censorship of LGBT issues State-enforced
Since 1962
Morocco has several censorship measures in place including LGBT media censorship. The 1962 Penal Code criminalises "obscenity" in public…
State-enforced
Since 2016
Since 2016, China censors LGBT content, including LGBT-themed films, TV shows, and media, under the General Principles for the Production…
No censorship
Since 1990
In Namibia, there are no laws restricting the discussion or promotion of LGBTQ+ topics since the reforms of the apartheid and independence…
Imprisonment as punishment
Since 1953
Article 421 of Libya's Penal Code prohibits "indecent acts and articles" with imprisonment of up to one year or a fine of up to 50 pounds…
Right to change legal gender Ambiguous
Since 2021
There is no legal framework to change one's gender marker in Morocco. However, since 2021, Morocco has has officially recognized intersex…
Legal, but requires surgery
Since 1986
The civil law of the People's Republic of China allows for legal gender change and requires undergoing sex reassignment surgery
Legal, but requires surgery
Since 1974
Trans people can change their legal gender based on a clause from the Births, Marriages and Deaths Registration Act 81 of 1963 under an…
Illegal
Transgender individuals are not able to change their legal gender.
Gender-affirming care Restricted
Morocco has no known law banning gender-affirming care and there have been historical cases of it being provided. However, access is…
Restricted
Transgender individuals have to receive approval from their family (even as adults) to receive gender-affirming care, and the Chinese…
Restricted
In Namibia, medical transition is legal but sex reassignment surgery is unavailable and hormones are only accessible privately.
Restricted
Gender-affirming care is inaccessible in Libya. However, there is no explicit ban on it.
Legal recognition of non-binary gender Intersex only
Since 2021
In 2021, Morocco passed Law 36.21, which provides intersex people with the opportunity for legal recognition and the option to change their…
Not legally recognized
China does not legally recognize a third gender.
Not legally recognized
There is no legal recognition of non-binary identities in Namibia.
Not legally recognized
There is no legal gender recognition provided to nonbinary or intersex people in Libya.
Hate crime protections No protections
Morocco does not provide hate crime protections based on sexual orientation or gender identity.
No protections
China does not provide hate crime protections based on sexual orientation or gender identity.
No protections
Namibia does not provide hate crime protections based on sexual orientation or gender identity.
No protections
Libya does not provide hate crime protections based on sexual orientation or gender identity.
LGBT discrimination No protections
There are no protections from discrimination provided to LGBTIQ+ people in Morocco.
Illegal in some contexts
Since 2026
In May 2026, after a citizen's petition, People's Supreme Court affirmed that it guided local courts to judge cases concerning LGBT…
Illegal in some contexts
Since 2018
The Broadcasting Code for Broadcasting Licensees issued in 2018 bans hate speech and violence of any person or group of persons because of…
No protections
There are no protections from discrimination provided to LGBTIQ+ people in Libya.
LGBT employment discrimination No protections
There are no protections from discrimination in employment provided to LGBTIQ+ people in Morocco.
Sexual orientation and gender identity
Since 2026
In May 2026, People's Supreme Court answered a citizen's petition stating that discrimination based on sexual orientation, gender identity…
No protections
Since 2007
There are no legal protections in employment. In 2021, a Namibian court has found that the constitution bans discrimination based on sexual…
No protections
There are no protections from discrimination in employment provided to LGBTIQ+ people in Libya.
LGBT housing discrimination No protections
There are no protections from discrimination in housing provided to LGBTIQ+ people in Morocco.
No protections
China does not have explicit protections for housing discrimination based on sexual orientation or gender identity.
No protections
There are no legal protections. In 2021, a Namibian court has found that the constitution bans discrimination based on sexual orientation…
No protections
There are no protections from discrimination in housing provided to LGBTIQ+ people in Libya.
Same-sex adoption Illegal
In Morocco, only single women and married couples are permitted to adopt. Single men are not allowed to and same-sex marriage is not…
Single only
China does not allow same-sex couples to adopt. However, there are no laws banning single gay people from adopting children.
Single only
In October 2021, the High Court Main Division ruled that the child of a same-sex couple born abroad through surrogacy had the right to…
N/A
In Libya, adoption, as understood in many Western contexts, is prohibited for everyone.
Intersex infant surgery Not banned
There is no ban on surgeries performed on intersex infants in Morocco.
Not banned
China does not ban “normalization” surgery performed on intersex infants. There are reports that such surgeries are widespread, often…
Not banned
Surgery on intersex infants is legal in Namibia but not reported.
Not banned
There is no ban on surgeries performed on intersex infants in Libya.
Serving openly in military Illegal
In Morocco, it was very illegal for any openly LGBTQIA+ people to serve in the military without facing consequences.
Ambiguous
China’s policy on homosexuals serving in the military is unclear. There appears to be no explicit ban, though some reports suggest that gay…
Legal
Since 2024
There are no laws prohibiting LGBTIQ+ people from serving in the military of Namibia.
Don't Ask, Don't Tell
Libya does not explicitly ban LGBTQ+ individuals from serving in the military. However, homosexuality is criminalized, so serving openly is…
Blood donations by MSMs Banned (indefinite deferral)
Due to homosexuality being illegal.
Banned (indefinite deferral)
Since 2012
Homosexual men who are sexually active with other men can not donate blood in China. However, in 2012, the Chinese Ministry of Health…
Legal
Namibia has a six month deferral period of sexual activity for blood donations for everyone regardless of sexual orientation.
Legal with restrictions
On Libya’s blood donation page, it states that donations from men who have sex with men are restricted due to the risk of HIV. However, on…
Bathroom access Restricted
In Morocco, there is no protections for trans people acess to the bathroom in fact due to article 489 of the Penal Code, which criminalizes…
No explicit protections
There are no explicit laws based on transgender people being able to use the restroom matching their identity.
No explicit protections
In Namibia, there are no explict protections for trans people or explict restrictions to their acess to the bathrooms.
Restricted (enforced with penalties or fines)
In Libya, the law contains zero explicit mentions of transgender people or public restrooms, Instead, transgender people are targeted…
Conversion therapy Not banned
Conversion therapy is not banned.
Not banned
China does not have a ban on conversion therapy that seeks to change an individual’s sexual orientation or gender identity, and public…
Not banned
Conversion therapy is not banned in Namibia and there have been several instances of “corrective” rape.
Not banned
Libya does not have a ban on conversion therapy that seeks to change an individual’s sexual orientation or gender identity

Public Opinion

Survey results on LGBTQ+ issues, newest first

  • Supportive
  • Neutral / no answer
  • Unsupportive
Survey
Morocco
China
Namibia
Libya
Perception of local area as a good place for gay peopleNot surveyed
47% Good Place
19% Good place
Not surveyed
Acceptance of homosexuals as neighbors
15% Tolerate
84% Oppose
28% Did not mention homosexuals
71% Mentioned homosexuals
49% Tolerate
49% Oppose
37% Did not mention homosexuals
63% Mentioned homosexuals
Justifiability of homosexuality
World Values Survey, 2017-2022
6% Justifiable
68% Not justifiable
7% Justifiable
80% Not justifiable
Not surveyed
1% Justifiable
92% Not justifiable
Support for same-sex marriage
14% Yes
65% No
Older data
63% Support
19% Against
Not surveyedNot surveyed
Views on same-sex couples' right to adopt
Ipsos, April–May, 2021
Not surveyed
66% Agree
30% Disagree
Not surveyedNot surveyed
Opinion on same-sex couples as parents
World Values Survey, 2017-2020
Older data
Not surveyed
12% Agree
60% Disagree
Not surveyedNot surveyed
Belief that transgender people should be allowed to marry a person of their birth sex
Ipsos / The Williams Institute, October-November 2017
Older data
Not surveyed
53% Agree
28% Disagree
Not surveyedNot surveyed
Belief that transgender people are violating country's culture
Ipsos / The Williams Institute, October-November 2017
Older data
Not surveyed
48% Disagree
35% Agree
Not surveyedNot surveyed
Belief that transgender people have a form of mental illness
Ipsos / The Williams Institute, October-November 2017
Older data
Not surveyed
48% Disagree
33% Agree
Not surveyedNot surveyed
Transgender people's bathroom choice
Ipsos / The Williams Institute, October-November 2017
Older data
Not surveyed
45% Agree
39% Disagree
Not surveyedNot surveyed

Full details about each issue can be found on each region's page. Data missing from the above chart? You can help! Sign up or log in to contribute information to Equaldex!

Share This Comparison