This paper studies the effect of institutions on trade flows, using a gravity modelapproach. We start from a standard gravity equation that incorporates geographical proximity,language, trade policy and common history. These factors reflect the costs of trade acrossgeographical and cultural distance. The quality of governance and the extent of familiaritywith the resulting framework of rules and norms may also affect the costs of doing businessbetween any pair of countries. This paper extends the gravity equation to include proxies forinstitutional quality and institutional homogeneity between trade partners. For this, we useindicators on political stability, regulatory quality, and other proxies that reflect thequality of governance. We test whether institutional homogeneity and institutional quality havean independent impact on the trade volume between pairs of countries. We find that having asimilar law or regulatory framework promotes bilateral trade by 12-18%. Furthermore, a better quality of formal institutions tends to coincide with moretrade. An increase in regulatory quality of one standard deviation from the mean leads to anestimated increase of 20-24% in bilateral trade. Lower corruption similarly accounts for 17-27%extra trade.