Hypertension is the leading risk factor for heart disease and stroke, and is estimated to cause 9.4 million deaths globally every year. The pathogenesis of hypertension is complex, but lifestyle factors such as diet are important contributors to the disease. High dietary intake of fruit and vegetables is associated with reduced blood pressure and lower cardiovascular mortality. A critical relationship between dietary intake and the composition of the gut microbiota has been described in the literature, and a growing body of evidence supports the role of the gut microbiota in the regulation of blood pressure. In this Review, we describe the mechanisms by which the gut microbiota and its metabolites, including short-chain fatty acids, trimethylamine N-oxide, and lipopolysaccharides, act on downstream cellular targets to prevent or contribute to the pathogenesis of hypertension. These effects have a direct influence on tissues such as the kidney, the endothelium, and the heart. Finally, we consider the role of the gut microbiota in resistant hypertension, the possible intergenerational effect of the gut microbiota on blood pressure regulation, and the promising therapeutic potential of gut microbiota modification to improve health and prevent disease.