The short answer
The core Confucian texts, including the Analects, do not directly address homosexuality or condemn it. Confucian ethics does, however, place great weight on marriage, family and continuing the family line, and those values have influenced attitudes in East Asian societies. As a result, Confucianism is not clearly “for” or “against” homosexuality in its original sources, and modern writers interpret the tradition in different ways.
What the classic texts say
Confucius and his early followers focused on virtue, ritual, learning and government. Same-sex relationships are not a topic in the Analects. There is no commandment or ruling on the subject comparable to the specific prohibitions found in some other religious texts. Anyone claiming that Confucius explicitly taught for or against homosexuality is going beyond what the main texts say.
Family, lineage and filial duty
The more indirect influence comes from filial piety. A saying attributed to Mencius holds that of the unfilial acts, having no descendants is the most serious. In a tradition that stresses carrying on the family line and honoring ancestors, marriage and children were expected duties, especially for sons. This expectation put pressure on many people, whatever their orientation, to marry and have children.
This is a social and family argument, not a direct statement about same-sex desire. Some interpreters note that a person could, in principle, reconcile Confucian duties with different life paths, while others see the emphasis on lineage as a real tension.
History in China
Records of same-sex relationships appear in Chinese history, including among members of the elite, and attitudes varied by period. Historians do not agree on a single picture. Legal and social hostility to same-sex conduct grew stronger in some later periods, and modern attitudes were also shaped by nineteenth- and twentieth-century influences from outside China. It is hard to attribute these changes to Confucianism alone, since law, politics, other religions and foreign ideas all played a role.
Modern views
Today, people in Confucian-influenced societies hold a wide range of opinions. Some stress traditional family values and are conservative. Others argue that humaneness (ren), reciprocity and respect for others support acceptance. For readers who want to see how this plays out, we also cover whether Confucianism is LGBT friendly more directly.
A note on interpretation
Because Confucianism is a broad tradition without a central authority, there is no single official position. Answers tend to depend on which texts, periods and thinkers one emphasizes. If you are researching the question, it helps to separate three things: what the classic texts say, what later laws and customs did, and what modern Confucian thinkers argue. For wider background, see what type of belief is Confucianism and how it relates to family and society.