"Otaku" is a Japanese slang term from the 1980s, referring to anyone perceived as having an irregular and obsessive interest in something. Often, this will refer to a specific field of interest, the most common of which are classically nerdy or unusual fields like technology, sci-fi, the military, idols, video games, and anime. However, this can also include more niche topics, from locomotion and cameras to the Three Kingdoms period of history.
While the technical definition ends there, the term is most well-known for the derogatory image associated with it, particularly when used without a specified field. These negative connotations tend to include a severe lack of social skills, unkempt appearance, irregular weight, laziness, extreme perversion, unhealthy diet, and even a complete detachment from/fear of the real world. These associations stem from the term's origins (which fall roughly in-line with worldwide perceptions of socially-troubled nerds), but have been intensified by Japanese news reports over the years blaming criminals' actions on otaku lifestyles, and later by English adoption of the term.
However, the term is not entirely negative, especially in the modern day. Those with such interests latched onto the term, as both a symbol of pride and of self-mockery, even at the time, and the negative associations have diminished slightly since the 1980s. Additionally, the economic impact of otaku has gained increased recognition, and grown to account for trillions of yen in spending, most famously centered on Tokyo's Akihabara district and Comic Market.
Possibly due to the long-running connection between otaku, anime, and video games, the otaku has become a somewhat common character in such media. These depictions are typically comedic in nature, but often temper the stereotype's more extreme associations, and additionally portray otaku as knowledgeable and dedicated when it comes to topics they care about, skilled with technology (even non-tech otaku), and sometimes even as being friendly underneath their awkward exteriors.
Outside of Japan
Following the niche popularity anime had acquired in America and Europe in the 1980s, English-speaking anime fans were first exposed to the term "otaku" in the early-90s, often attributed to translations of Gunbuster and Otaku no Video. As the term was picked up by English speakers, the term's connotations mostly remained both in the mixed meaning used by fans and the negative image conjured by broader discussions, although both tend to be less negative than the term's Japanese origins. Some non-anime fans also took to calling them "weeaboos" or "weebs", intending to evoke only the negative connotations.
As anime has gained widespread popularity overseas, use of terms such as otaku and weeaboo has become less common among American and European fans. Despite this, the term is still seen among those who are especially fond of anime, or who have been fans of anime for a long time.