The paper examines gender differences in standardized test scores in an elite school environment by using Hungarian data. Raw test score averages suggest large gender differences in mathematics. By applying a Fuzzy Regression Discontinuity design the paper seeks to answer whether such differences come from females failing to perform well in a competitive elite school environment or avoiding it by sorting to lower-achieving elite schools. It finds evidence for both. Regarding mathematics test scores, females benefit by around 0.1 standard deviation less from elite schools than male counterparts, meanwhile the remainder of the raw test score differences can be explained by students self-selection.