Metformin is the first line treatment for type 2 diabetes (T2D). Although widely prescribed, the glucose-lowering mechanism for metformin is incompletely understood. Here we used a genome-wide association approach in a diverse group of individuals with T2D from the Action to Control Cardiovascular Risk in Diabetes (ACCORD) clinical trial to identify common and rare variants associated with HbA1c response to metformin treatment, and followed up these findings in four replication cohorts. Common variants in PRPF31 and CPA6, were associated with worse and better metformin response, respectively (p<5×10-6), and meta-analysis in independent cohorts displayed similar associations with metformin response (p=1.2×10-8 and p=0.005, respectively). Previous studies have shown that PRPF31(+/-) knockout mice have increased total body fat (p=1.78×10-6) and increased fasted circulating glucose (p=5.73×10-6). Furthermore, rare variants in STAT3 associated with worse metformin response(q<0.1). STAT3 is a ubiquitously expressed pleiotropic transcriptional activator that participates in the regulation of metabolism and feeding behavior. Here we provide novel evidence for associations of common and rare variants in PRPF31, CPA6, and STAT3 with metformin response that may provide insight into mechanisms important for metformin efficacy in T2D.