We argue that, for a given level of scientific knowledge, tolerance and diversity are conducive to technological creativity and innovation. In particular, we show that variations in innovation within Prussia during the second industrial revolution can be ascribed to differences in religious tolerance that developed in continental Europe from the Peace of Westphalia onwards. By matching a unique historical dataset about religious tolerance in 1,278 Prussian cities with valuable patents for the period 1877-1890, we show that higher levels of religious tolerance are strongly positively associated with innovation during the second industrial revolution. Religious tolerance is measured through population’s religious diversity, diversity of churches, and diversity of preachers and religious teachers, respectively. Endogeneity issues are addressed using local variation across cities, within counties. Estimates using preindustrial levels of religious tolerance address issues of reverse causality. As for the channels of transmission, we find significant complementarity between religious tolerance and human capital. Furthermore, we find that cities with higher levels of religious tolerance attracted a larger share of migrants. Finally, higher levels of religious diversity in the population translated into higher levels of religious diversity in the workforce by industrial sector. This result suggests that religious diversity did not generate labor market segmentation by denomination but might have fostered interaction of different denominations.