We study the importance of technology and institutions in determining the size of markets in …ve di¤erent countries and …fteen di¤erent German states. The setting of 19th century Europe presents a unique opportunity to address this issue, since it witnessed fundamental change in both dimensions. At the beginning of the century, numerous customs borders, separate currencies with di¤erent monetary systems, and poor transportation facilities were major obstacles that held back trade. Important institutional change, through the Zollverein customs treaties and currency uni…cation, and major technological innovations in the steam train all had a role in increasing market size as measured in terms of the spatial dispersion of grain prices across 68 markets. However, we …nd that the impact of steam trains is substantially larger than the e¤ects from customs liberalizations and currency agreements in increasing market size, where correcting for the potential endogeneity in institutional and technological changes are crucial for this result. We also …nd that a state's institutions in ‡uence the rate of adoption of steam trains, thereby identifying an important indirect e¤ect from institutions on economic performance. The institutional and technological changes account for almost all of the decline in price gaps over this period.