The objective of this paper is to analyze why firms in some industries locate in specialized economic environments (localization economies) while those in other industries prefer large city locations (urbanization economies). To this end, we examine the location decisions of new manufacturing firms in Spain at the city level and for narrowly defined industries. First, we estimate firm location models to obtain estimates that reflect the importance of localization and urbanization economies in each industry. Then, we regress these estimates on industry characteristics related to the potential importance of labor market pooling, input sharing, and knowledge spillovers. Urbanization effects are high in knowledge-intensive industries, suggesting that firms locate in large cities to benefit from knowledge spillovers. We also find that localization effects are high in industries that employ workers whose skills are more industry-specific, suggesting that industries locate in specialized economic environments to share a common pool of specialized workers.