ABSTRACT This article analyses the impact of educational segregation on the gender gap in the probability of working in a gendered or gender-balanced occupation, which is our measure of occupational segregation. Specifically, our methodology allows quantifying two different effects of education on this gap: one due to girls and boys choosing different educational options (presorting), and the other due to men and women with the same education entering the same or different occupations (postsorting). Using a sample of university graduates from Spain, a country with a highly segregated labour market, we conclude that the gender composition of education and occupation are strongly related. However, the greater presence of women in female-dominated jobs is not only due to them choosing female-dominated degrees, but also due to many women from gender-balanced, and even some from male-dominated programmes, working in female-dominated occupations. Thus, reducing educational segregation does not seem to be enough to fight against occupational segregation. It is also necessary to guarantee that men and women enjoy the same opportunities in the labour market, removing discrimination practices, and to ensure that both, workers and employers, do not make decisions based on gender role expectations or stereotypes.