We leverage variation in the timing of women's colleges' transitions to coeducation throughout the 1960s-2000s to study how exposure to a gendered social environment affects women's human capital investments. Applying event study and synthetic control analyses to newly collected historical data, we find that the share of women majoring in STEM at newly coeducational colleges declined by 2.0 percentage points (24%) after ten years of coeducation. Coeducation induced a large increase in the male share of the student body, but did not measurably influence the male share of faculty, capacity constraints or the ability composition of female students. A simple extrapolation of our main estimate suggests that gendered peer effects can account for 34% of the gender gap in STEM majoring. These findings support the hypothesis that non-pecuniary factors, related to social norms and gender roles, shape gender gaps in major choice.