This paper examines the determinants of the wage penalty experienced by undocumented workers, defined as the wage gap between observationally equivalent legal and undocumented immigrants. Using recently developed methods that impute undocumented status for foreign-born persons sampled in microdata surveys, the study documents a number of empirical findings. Although the unadjusted gap in the log hourly wage between the average undocumented and legal immigrant is very large (over 35%), almost all of this gap disappears once the calculation adjusts for differences in observable socioeconomic characteristics. The wage penalty to undocumented immigration for men was only about 4% in 2016. Nevertheless, there is sizable variation in the wage penalty over the life cycle, across demographic groups, across different legal environments, and across labor markets. The flat age-earnings profiles of undocumented immigrants, created partly by slower occupational mobility, implies a sizable increase in the wage penalty over the life cycle; the wage penalty falls when legal restrictions on the employment of undocumented immigrants are relaxed (as with DACA) and rises when restrictions are tightened (as with E-Verify); and the wage penalty responds to increases in the number of undocumented workers in the labor market, with the wage penalty being higher in those states with larger undocumented populations.