Precision medicine aims to treat an individual based on their clinical characteristics. A differential drug response, critical to using these features for therapy selection, has never been examined directly in type 2 diabetes. We tested two hypotheses: 1) individuals with BMI>30kg/m2, compared with BMI ≤30kg/m2, have greater glucose lowering with thiazolidinediones than DPP4-inhibitors, and 2) individuals with eGFR 60-90mls/min/1.73m2 compared with eGFR >90mls/min/1.73m2 have greater glucose lowering with DPP4-inhibitors than SGLT2-inhibitors. The primary endpoint for both hypotheses was the achieved HbA1c difference between strata for the two drugs. 525 people with type 2 diabetes participated in a UK based randomised, double-blind, three-way crossover trial of 16 weeks treatment with each of sitagliptin 100mg/day, canagliflozin 100mg/day and pioglitazone 30mg/day added to metformin alone or metformin plus sulfonylurea. Overall, the achieved HbA1c was similar for the three drugs pioglitazone 59.6 mmol/mol , sitagliptin 60.0 mmol/mol, canagliflozin 60.6 mmol/mol (p=0.2). Participants with BMI>30kg/m2, compared with BMI≤30kg/m2, had a 2.88 mmol/mol (95% CI 0.98,4.79) lower HbA1c on pioglitazone than on sitagliptin (n=356, P=0.003). Participants with eGFR 60-90mls/min/1.73m2, compared with eGFR >90mls/min/1.73m2, had a 2.90 mmol/mol (95% CI 1.19,4.61) lower HbA1c on sitagliptin than on canagliflozin (n=342, P=0.001). There were 2201 adverse events reported, and 447/525 (85%) randomised participants experienced an adverse event on at least one of the study drugs. In this precision medicine trial in type 2 diabetes, our findings support the use of simple routinely available clinical measures to identify the drug class most likely to deliver the greatest glycaemic reduction for a given patient. ClinicalTrials.gov registration: NCT02653209; ISRCTN registration12039221.