Although it is well documented that women are under-represented in STEM majors, the causes of this under-representation in different contexts are less clear. This article studies the relevance of absolute and relative performance in high school courses on STEM field enrollment when entering college in Chile. We use administrative countrywide data and follow three student cohorts through high school to estimate the effect of performance on courses in high school on major enrollment at the university level. Our estimation confirms the existence of a large gender gap: male students are about 20% points more likely to enroll in a STEM field than similar female students, which we observe all along the academic achievement distribution. These findings suggest it would be beneficial for policymakers to focus on earlier interventions during high school that create incentives and address systemic and cultural issues that might be preventing women from enrolling into STEM fields.