While homosexuality had never been viewed as a sin in Japanese society and religion, sodomy was restricted by legal prohibition in 1873, but the provision was repealed only seven years later by the Penal Code of 1880 Exposure to Western religious thought and the desire to appear "civilized" have influenced the way that homosexuality is viewed by both the Japanese government and by the population at large since the end of the nineteenth century.
Currently, dōseiaisha (同性愛者, literally same-sex-loving person), gei (ゲイ,gay), homosekushuaru (ホモセクシュアル,homosexual), rezu or rezubian (レズ、レズビアン, transliterations of lesbian) and homo（ホモ） are the most common terms. While dōseiaisha is used to refer to both women and men, gei, homosekushuaru and homo are used almost exclusively in reference to men.
The term gay is almost never used in discussing ancient and historical sources because of the modern, western, political connotations of the word and because the term suggests a particular identity, one with which homosexuals even in modern Japan may not identify.
The term homo can be used both positively and pejoratively. Nowadays the terms gei (ゲイ, a transliteration of gay) and rezu or rezubian (レズ、レズビアン, transliterations of lesbian) are the most common in the gay community, while largely pejorative terms like okama (see Slang section) are also used.
According to Gary Leupp, the ancient Japanese associated nanshoku with China, a country from which borrowed ideas became the basis for much of Japanese high culture, including their writing system (kanji, Chinese characters). The Japanese nanshoku tradition drew heavily on that of China (see Homosexuality in China).
A variety of obscure literary references to same-sex love exist in ancient sources, but many of these are so subtle as to be unreliable; another consideration is that declarations of affection for friends of the same sex were also common.
Nevertheless, references do exist, and they become more numerous in the Heian Period, roughly the 11th century. In Genji Monogatari (源氏物語, The Tale of Genji), written in the early 11th century, men are frequently moved by the beauty of youths. In one scene a lady is rejected by the hero who instead sleeps with her brother:
The Tale of Genji is a novel, but there exist several Heian-era diaries which contain references to homosexual acts as well. Some of these also contain references to Emperors involved in homosexual relationships and to "handsome boys retained for sexual purposes" by Emperors.
There can be found references to what Leupp has called "problems of gender identity" in other literary works, such as the story of a youth falling in love with a girl who is actually a cross-dressing male.
Buddhist monasteries appear to have been early centres of homosexual activity in ancient Japan. It was popularly said that Kūkai, the founder of the Shingon Buddhist sect, introduced nanshoku into Japan after returning from Tang China in the 9th century. However he does not discuss this theme in any of his major works. It should also be noted that any sexual activity was expressly forbidden by the Vinaya or code of monastic discipline for Buddhist monks, and Kūkai was an enthusiastic upholder of the Vinaya. At the same time, Mount Koya, the seat of Kūkai's monastery, became a by-word for same-sex love.
However neither Shinto nor the Japanese interpretation of Confucianism contained any prohibitions. Enough monks seem to have felt their vows of chastity did not apply to same-sex relations that stories of affairs between monks and young acolytes, known as Chigo Monogatari were quite popular, and such affairs were lightly joked about, when the passions did not rise to the level of violence, which was not uncommon. Jesuits reported aghast on the 'sodomy' that occurred among Buddhist clergy.
From religious circles, same-sex love spread to the warrior class, where it was customary for a young samurai to apprentice to an older and more experienced man. The young samurai would be his lover for many years. The practice was known as shudo, the way of youth, and was held in high esteem by the warrior class.
Male prostitutes who catered to a male clientele, known as kagema, were also available.
Despite the recent trends that suggest a new level of tolerance, as well as open scenes in more cosmopolitan cities (such as Tokyo and Osaka), Japanese homosexuals often conceal their sexuality; with many even marrying persons of the opposite sex to avoid discrimination.
Japan has no laws against homosexual activity, and has some legal protections for homosexuals. In addition, there are some legal protections for transgender individuals. (See Gay rights in Japan.)
While civil rights laws do not extend to protection from discrimination based on sexual orientation, some governments have enacted such laws. The government of Tokyo has passed laws that ban discrimination in employment based on sexual identity.
The major political parties express little public support for gay rights issues. Despite recommendations from the Council for Human Rights Promotion, the Diet has yet to take action on including sexual orientation in the country's civil rights code.
Some political figures, however, are beginning to speak publicly about their own homosexuality. Kanako Otsuji, an assemblywoman from Osaka, came out as a lesbian in 2005. Two years earlier, in 2003, Aya Kamikawa became the first openly transgender elected official in Tokyo, Japan.
A number of personalities who appear on television in Japan daily are transvestites, gay or transgender, or cultivate such an image as part of their public persona.
In recent years, a small number of artists, nearly all male, have begun to speak publicly about their homosexuality. They often appear on various talk shows and other programmes. Dancer and tarento Kaba-chan, tarento Gakuseifuku Sakamoto, ikebana master Shougo Kariyazaki, comedian Ken Maeda, and twin pop-culture critics Piko and Osugi are among these.
Akihiro Miwa, a drag queen and former lover of author Yukio Mishima, is the television advertisement spokesperson for many Japanese companies ranging from beauty to financial products and TEPCO. Kenichi Mikawa, a former pop idol singer who now blurs the line between male and female costuming and make-up, can also regularly be seen on various programs, as can transvestite entertainer Peter-san. Singer-songwriter and actress Ataru Nakamura was one of the first transgendered personalities to become highly popular in Japan; in fact, sales of her music actually rose after she discussed her MTF gender reassignment surgery on the variety show Boku no Ongaku in 2006.
Some non-gay entertainers have also used homosexuality to increase their profile. Razor Ramon Hard Gay (HG), a comedian, shot to fame after he began to appear in public wearing a leather harness, hot pants and cap. His outfit, name, and trademark pelvis thrusting and squeals earned him the adoration of fans and the scorn of many in the Japanese gay community.
The blanket term "yaoi" is an acronym for the phrase "Yama nashi, ochi nashi, imi nashi", which means "no peak, no point, no meaning". (A backronym meant as a joke identifies it as "Yamete, oshiri (ga) itai" which literally means "Stop, my ass hurts!").
"June" refers to plots containing homosexual romance and drama that feature mature adult male characters. "BL" ("Boys' Love") refers to stories that either contain younger characters, or more light-hearted romance (as an alternative to more sexual content). The phrase "shōnen-ai", translated from Japanese in the past as "boy love", is used to describe non-sexual homosexuality in either adult male characters or younger male characters. When manga or anime depicts sexual activities between young boys, or young boys with adults, it is known as "shotacon", which should not be confused with "shōnen-ai".
Among the large fan demographics in North America and Europe, this terminology is more or less condensed to "yaoi" and "shōnen-ai"; "yaoi" is used in reference to graphic descriptions of homosexual sex and/or adult drama, and "shōnen-ai" is used in reference to romantic situations with younger characters.
Gei-comi ("gay-comics") are homosexual comics aimed at gay men. While yaoi comics often assign one partner to a stereotypical heterosexual female role, gei-comi generally depict both partners as masculine and in an equal relationship.
Lesbian content is much less widespread, but does exist, and is known as yuri. Yuri is pretty much a catch-all term, much more than yaoi, possibly due to the distribution of each. However, American and European fans tend to use yuri only in reference to stories with graphic depictions of lesbian sex, and label purely romantic stories as "shōjo-ai". (This frequently creates confusion, as, in Japan, the term shōjo-ai does not mean lesbian content; rather, it is used to describe stories with explicit sex between adult men and underaged girls.) Another word that has recently become popular in Japan as an equivalent of yuri is "GL" (meaning "Girls' Love" and obviously inspired by "Boys' Love").
Some manga, generally appealing more overtly to prurient interest, are directly aimed at the gay market. These, however, are uncommon and generally not found except in speciality shops.
Some anime and manga that are not specifically aimed at women or homosexuals also include gay characters as side-characters, such as Mr. 2 Bon Clay in the anime and manga One Piece, or Akito Wanijima in Air Gear, which are shōnen manga (manga that is targeted at young boys).
There are also several homosexual characters in the the animated works of Satoshi Kon.