Gender differences in math performance are now small in developed countries and they cannot explain on their own the strong under-representation of women in math-related fields. This latter result is however no longer true once gender differences in reading performance are also taken into account. Using individual-level data on 300,000 15-yearold students in 64 countries, we show that the difference between a student performance in reading and math is 80% of a standard deviation larger for girls than boys, a magnitude considered as very large. When this difference is controlled for, the gender gap in students' intentions to pursue math-intensive studies and careers is reduced by around 75%, while gender gaps in self-concept in math, declared interest for math or attitudes towards math entirely disappear. These latter variables are also much less able to explain the gender gap in intentions to study math than is students' difference in performance between math and reading. These results are in line with choice models in which educational decisions involve intra-individual comparisons of achievement and self-beliefs in different subjects as well as cultural norms regarding gender. To directly show that intra-individual comparisons of achievement impact students' intended careers, we use differences across schools in teaching resources dedicated to math and reading as exogenous variations of students comparative advantage for math. Results confirm that the comparative advantage in math with respect to reading at the time of making educational choices plays a key role in the process leading to women's under-representation in math-intensive fields.