Women and girls are underrepresented in many, though not all, STEM (science, technology, engineering and mathematics) fields around the world. In this Review, we describe four key factors that help explain the continued underrepresentation of women in STEM. In many parts of the world, women lack access to education and job opportunities, preventing them from pursuing STEM. In places where women do have educational and professional opportunities, masculine culturesshaped by both masculine defaults and differential treatment -can hinder entry and retention of women in STEM fields. Addressing masculine cultures is important to increase the representation of women, and research has identified multiple promising avenues for intervention. When masculine cultures remain, gender disparities can be reduced by increasing the positive experiences of women and girls in STEM. Finally, choices made by men to enter some STEM fields also contribute to the underrepresentation of women in these fields. We conclude by reviewing promising future directions for research on gender disparities in STEM, including examining the intersections of these factors, sociopolitical and economic contexts, and the experiences of trans and non-binary individuals and people with multiple marginalized identities in STEM.Sections in the USA are girls, less than one-third (31%) of computer science Advanced Placement test-takers are girls 34 . Additionally, in the USA, girls in grades 1-12 express less interest than boys in computer science and engineering 35 .Finally, in some places, women and girls are not underrepresented in computer science or engineering during schooling but are underrepresented in these occupations (Fig. 1 and Supplementary Table 3). In the United Arab Emirates, a majority (55%) of information and computer science degrees are granted to women 27 , but only 20% of information and communication technology professionals are women 10 . In Argentina, 42% of the postsecondary degrees in engineering are earned by women 26 , but women comprise only 28% of science and engineering professionals 10 . Many women who pursue computer science and engineering do not enter or remain in these occupations owing to social norms or pressures to care for family and perceptions that women do Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.