Earlier literature on the gender pay gap has taught us that occupations matter and so do firms. However, the role of the firm has received little scrutiny; occupations have most often been coded in a rather aggregate way, lumping together different jobs; and the use of samples of workers prevents any reliable determination of either the extent of segregation or the relative importance of access to firms versus occupations. Our contribution is twofold. We provide a clear measure of the impact of the allocation of workers to firms and to job titles shaping the gender pay gap. We also provide a methodological contribution that combines the estimation of sets of high-dimensional fixed effects and Gelbach's (2009) unambiguous decomposition of the conditional gap. We find that one fifth of the gender pay gap results from segregation of workers across firms and one fifth from job segregation. We also show that the widely documented glass ceiling effect operates mainly through worker allocation to firms rather than occupations.