Gender differences in achievement exhibit variation between domains and between countries. Much prior research has examined whether this variation could be due to variation in gender equality in opportunities, with mixed results. Here we focus instead on the role of a society's values about gender equality, which may have a more pervasive influence. We pooled all available country measures on adolescent boys' and girls' academic achievement between 2000 and 2015 from the Program for International Student Assessment (PISA) and Trends in International Mathematics and Science Study (TIMSS) assessments of math, science, and reading. We then analyzed the relation between gender differences and country levels of gender egalitarian values, controlling for country levels of living standards and indicators of gender equality in opportunities. Gender egalitarian values came out as the most important predictor. Specifically, more gender egalitarian values were associated with improved performance of boys relative to girls in the same countries. This pattern held in reading, where boys globally perform substantially worse than girls, as well as in math and science where gender differences in performance are small and may favor either boys or girls. Our findings suggest a previously underappreciated role of cultural values in moderating gender gaps in academic achievement.