This paper provides a quantitative assessment of the economic contribution of unauthorized workers to the U.S. economy, and the potential gains from legalization. We employ a theoretical framework that allows for multiple industries and a heterogeneous workforce in terms of skills and productivity. Capital and labor are the inputs in production and the different types of labor are combined in a multi-nest CES framework that builds on Borjas (2003) and Ottaviano and Peri (2012). The model is calibrated using data on the characteristics of the workforce, including an indicator for imputed unauthorized status (Center for Migration Studies, 2014), and industry output from the Bureau of Economic Analysis. Our results show that the economic contribution of unauthorized workers to the U.S. economy is substantial, at approximately 3% of private-sector GDP annually, which amounts to close to $5 trillion over a 10-year period. These effects on production are smaller than the share of unauthorized workers in employment, which is close to 5%. The reason is that unauthorized workers are less skilled and appear to be less productive, on average, than natives and legal immigrants with the same observable skills. We also find that legalization of unauthorized workers would increase their contribution to 3.6% of private-sector GDP. The source of these gains stems from the productivity increase arising from the expanded labor market opportunities for these workers which, in turn, would lead to an increase in capital investment by employers.