Genomic studies have greatly advanced our understanding of the multifactorial aetiology of type 2 diabetes mellitus (T2DM) as well as the multiple subtypes of monogenic diabetes mellitus. In this Review, we discuss the existing pharmacogenetic evidence in both monogenic diabetes mellitus and T2DM. We highlight mechanistic insights from the study of adverse effects and the efficacy of antidiabetic drugs. The identification of extreme sulfonylurea sensitivity in patients with diabetes mellitus owing to heterozygous mutations in HNF1A represents a clear example of how pharmacogenetics can direct patient care. However, pharmacogenomic studies of response to antidiabetic drugs in T2DM has yet to be translated into clinical practice, although some moderate genetic effects have now been described that merit follow-up in trials in which patients are selected according to genotype. We also discuss how future pharmacogenomic findings could provide insights into treatment response in diabetes mellitus that, in addition to other areas of human genetics, facilitates drug discovery and drug development for T2DM.