Most research on attitudes towards immigrants and immigration problematically conflates the documented and the undocumented. Previous studies also largely ignore the autonomous role of population density. Based on data drawn from two nationally representative surveys, this paper focuses on contemporary American attitudes towards undocumented immigration and immigrants. Contra the dominant view, we find that education and income have no effect. More important, population density, measured at the county level, significantly predicts favorable attitudes, controlling for factors often erroneously conflated with density: race, income, education, political affiliation, age, gender, and interaction with immigrants. In fact, interaction tends to decrease favorable attitudes. We explain these findings by proposing a novel account of cosmopolitanism, using favorable attitudes towards undocumented immigrants and immigration as an empirical indicator. Those who live in places with higher density are more used to see and be seen in everyday life by countless people with whom they share the same spaces without necessarily interacting with them. As a result, they are more likely to consider all them, including undocumented immigrants, in a superficial yet egalitarian way as generalized others to be ignored. It is this tolerance based on general indifference that is the basis of cosmopolitanism.