Metformin is the first-line antidiabetic drug with over 100 million users worldwide, yet its mechanism of action remains unclear. Here the Metformin Genetics (MetGen) Consortium reports a three-stage genome-wide association study (GWAS), consisting of 13,123 participants of different ancestries. The C allele of rs8192675 in the intron of SLC2A2, which encodes the facilitated glucose transporter GLUT2, was associated with a 0.17% (P = 6.6 × 10(-14)) greater metformin-induced reduction in hemoglobin A1c (HbA1c) in 10,577 participants of European ancestry. rs8192675 was the top cis expression quantitative trait locus (cis-eQTL) for SLC2A2 in 1,226 human liver samples, suggesting a key role for hepatic GLUT2 in regulation of metformin action. Among obese individuals, C-allele homozygotes at rs8192675 had a 0.33% (3.6 mmol/mol) greater absolute HbA1c reduction than T-allele homozygotes. This was about half the effect seen with the addition of a DPP-4 inhibitor, and equated to a dose difference of 550 mg of metformin, suggesting rs8192675 as a potential biomarker for stratified medicine.