Economists are often puzzled by the stronger public opposition to immigration than trade, since the two policies have similar effects on wages. Unlike trade, however, immigration can alter the composition of the local population, imposing potential externalities on natives. While previous studies have addressed fiscal spillover effects, a broader class of externalities arise because people value the 'compositional amenities' associated with the characteristics of their neighbors and co-workers. In this paper we present a new method for quantifying the relative importance of these amenities in shaping attitudes toward immigration. We use data for 21 countries in the 2002 European Social Survey, which included a series of questions on the economic and social impacts of immigration, as well as on the desirability of increasing or reducing immigrant inflows. We find that individual attitudes toward immigration policy reflect a combination of concerns over conventional economic impacts (i.e., wages and taxes) and compositional amenities, with substantially more weight on the latter. Most of the difference in attitudes toward immigration between more and less educated natives is attributable to heightened concerns over compositional amenities among the less-educated.