OBJECTIVE To determine the association between use of sulphonylureas and risk of hypoglycaemia in relation to renal function and sulphonylurea metabolic group compared with use of metformin. DESIGN Population based cohort study using routinely collected data from general practices in England. SETTING Clinical Practice Research Datalink (CPRD) database, 2004-12. PARTICIPANTS 120 803 new users of a non-insulin antidiabetic agent with at least one prescription and aged 18 years or more. The first prescription defined start of follow-up. Patients were followed until the end of data collection, a record for hypoglycaemia, or a blood glucose level of less than 3.0 mmol/L. MAIN OUTCOME MEASURES Associations between sulphonylurea dose, renal impairment, type of sulphonylurea used, and risk of hypoglycaemia, were determined using Cox proportional hazard models. Adjustments were made for age, sex, lifestyle, comorbidity, and drug use. RESULTS The risk of hypoglycaemia in current users of sulphonylureas only was significantly increased compared with current users of metformin only (adjusted hazard ratio 2.50, 95% confidence interval 2.23 to 2.82). The higher risk in current users of sulphonylureas only was further increased in patients with an estimated glomerular filtration rate of less than 30 mL/min/1.73 m(2) (4.96, 3.76 to 6.55). The risk of hypoglycaemia was also significantly higher in patients with a high sulphonylurea dose (3.12, 2.68 to 3.62) and in current users of glibenclamide (7.48, 4.89 to 11.44). Gliclazide, the sulphonylurea of first choice, showed a similar risk of hypoglycaemia compared with other sulphonylureas. CONCLUSIONS Sulphonylurea treatment in patients with a renal function of less than 30 mL/min/1.73 m(2) should be considered with caution. Moreover, an increased risk of hypoglycaemic events was observed among all users of sulphonylureas. This contrasts with several guidelines that recommend gliclazide as first choice sulphonylurea, and therefore requires further investigation.