We provide a new explanation for the narrowing and reversal of the gender education gap. We assume that parents maximize the full income of their children and that males have an additional income, independently of education. This additional income biases preferences toward sons and implies that females have relative advantage in producing income through education. When the returns to human capital are low, the bias toward sons is high, so that parents whose first newborns are females have more children. Consequently, daughters are born to larger families and hence receive less education. As returns to human capital increase, gender differences in producing income diminish, bias toward sons declines, variation in family size falls and the positive correlation between family size and the number of daughters is weakened. Ultimately, the relative advantage of females in education dominates differences in family size, triggering the reversal in the gender education gap.