Fertility rates have been declining worldwide over the past 50 years, part of a phenomenon known as “the demographic transition.” Prior work suggests that this decline is related to population density. In the present study, we draw on life history theory to examine the relationship between population density and fertility across 174 countries over 69 years (1950 to 2019). We find a robust association between density and fertility over time, both within and between-countries. That is, increases in population density are associated with declines in fertility rates, controlling for a variety of socioeconomic, socioecological, geographic, population-based, and female empowerment variables. We also tested predictions about environmental boundary conditions. In harsher living conditions (e.g., higher homicide or pathogen rates), the effect of increased population density on fertility rates was attenuated. The density-fertility association was also moderated by religiousness and strength of social norms, where the relationship between density and fertility was attenuated in countries with high religiosity and strong social norms. We discuss why and when changes in population density may influence fertility rates and the broader implications of this work.