Women have historically been underrepresented in STEM majors and occupations, a gap that has persisted over time. There are concerns that this is related to academic choices made at an earlier age. The purpose of this paper is to examine how social environment affects women's STEM choices as early as high school. Using administrative data from China, we find that exposure to high-performing female peers in mathematics increases the likelihood that women choose a science track during high school, while more highperforming males decrease this likelihood. We also find that peer quality has persistent effects on college outcomes. Overall, there is little evidence of peer effects for boys. Our results suggest that girls doing well in mathematics provide an affirmation effect that encourages female classmates to pursue a STEM track.