We use a unique match between the 2000 Decennial Census of the United States and the Longitudinal Employer Household Dynamics (LEHD) data to analyze how much of the increase in the gender earnings gap over the lifecycle comes from shifts in the sorting of men and women across high- and low-pay establishments and how much is due to differential earnings growth within establishments. We find that for the college educated the increase is substantial and, for the most part, due to differential earnings growth within establishment by gender. The between component is also important. Differential mobility between establishments by gender can explain 27 percent of the widening of the pay gap for this group. For those with no college, the, relatively small, increase of the gender gap over the lifecycle can be fully explained by differential moves by gender across establishments. The evidence suggests that, for both education groups, the between-establishment component of the increasing wage gap is due almost entirely to those who are married.