The term likely originated in the 1950s and gained popularity in the 1980s, associated with people who were passionate about science fiction, fantasy, video games, or technology.
However, the term has evolved over time and is often used in a more neutral or even positive way, especially by those who embrace their interests.
It's important to remember that using the term "nerd" can be offensive to some people, so it's best to be aware of the context and the potential implications of your words.