My DD11 (7th grader) is a self proclaimed nerd. She has friends who are "popular" but she does not hang out with them. The friends she hangs out with are mostly nerds like herself. She does not see anything wrong with that. She is happy that she finds someone who she shares similar interest and have things to talk about.

We often talks about the life after MS and HS for popular kids and nerds at home. The history (Bill Gates, Mark Zackerberg, etc..)and statistics (athelets, cheerleaders vs. top 1% academically in HS) are on our side. They encourage the underdog and tend to have lunch at the special need kids table. Hopefully they stay that way.