Anime are often classified by target demographic, including kodomo (children's), shōjo (girls'), shounen (boys') and a diverse range of genres targeting an adult audience. Shoujo and shounen anime sometimes contain elements popular with children of both sexes in an attempt to gain crossover appeal. Adult anime may feature a slower pace or greater plot complexity that younger audiences typically find unappealing, as well as adult themes and situations. A subset of adult anime works feature pornographic elements and are labeled "R18" in Japan, but internationally these works are grouped together under the term hentai (Japanese for "pervert"). By contrast, a variety of anime sub-genres across demographic groups incorporate ecchi, sexual themes or undertones without depictions of sexual intercourse, as typified in the comedic or harem genres; due to its popularity among adolescent and adult anime enthusiasts, incorporation of ecchi elements in anime is considered a form of fan service.
Anime's genre classification is different from other types of animation and does not lend itself to simple identity. Gilles Poitras compared the labeling Gundam 0080 and its complex depiction of war as a "giant robot" anime akin to simply labeling War and Peace a "war novel". Science fiction is a major anime genre and includes important historical works like Tezuka's Astro Boy and Yokoyama's Tetsujin 28-go. A major sub-genre of science fiction is mecha, with the Gundam metaseries being iconic. The diverse fantasy genre includes works based on Asian and Western traditions and folklore; examples include the Japanese feudal fairytale InuYasha, and the depiction of Scandinavian goddesses who move to Japan to maintain a computer called Yggdrasil in Oh My Goddess.
Genre crossing in anime is also prevalent, such as the blend of fantasy and comedy in Dragon Half, and the incorporation of slapstick humor in the crime anime Castle of Cagliostro. Other subgenres found in anime include magical girl, harem, sports, martial arts, literary adaptations and war.
Genres have emerged that explore homosexual romances. While originally pornographic in terminology, yaoi (male homosexuality) and yuri (female homosexuality) are broad terms used internationally to describe any focus on the themes or development of romantic homosexual relationships. Prior to 2000, homosexual characters were typically used for comedic effect, but some works portrayed these characters seriously or sympathetically.