OBJECTIVES: Against a backdrop of rising levels of obesity, we describe and estimate associations of body mass index (BMI), age and gender with time to revision for participants undergoing primary total hip (THR) or knee (TKR) replacement in the UK. DESIGN: Population-based cohort study. SETTING: Routinely collected primary care data from a representative sample of general practices, including linked data on all secondary care events. PARTICIPANTS: Population-based cohort study of 63 162 patients with THR and 54 276 with TKR in the UK General Practice Research Database between 1988 and 2011. PRIMARY AND SECONDARY OUTCOMES: Risk of THR and TKR revision associated with BMI, age and gender, after adjusting for the competing risk of death. RESULTS: The 5-year cumulative incidence rate for THR was 2.2% for men and 1.8% for women (TKR 2.3% for men, 1.6% for women). The adjusted overall subhazard ratio (SHR) for patients with THR undergoing subsequent hip revision surgery, with a competing risk of death, were estimated at 1.020 (95% CI 1.009 to 1.032) per additional unit (kg/m(2)) of BMI, 1.23 (95% CI 1.10 to 1.38) for men compared with women and 0.970 (95% CI 0.967 to 0.973) per additional year of age. For patients with TKR, the equivalent estimates were 1.015 (95% CI 1.002 to 1.028) for BMI; 1.51 (95% CI 1.32 to 1.73) for gender and 0.957 (95% CI 0.951 to 0.962) for age. Morbidly obese patients with THR had a 65.5% increase (95% CI 15.4% to 137.3%, p=0.006) in the subhazard of revision versus the normal BMI group (18.5-25). The effect for TKR was smaller (a 43.9% increase) and weaker (95% CI 2.6% to 103.9%, p=0.040). CONCLUSIONS: BMI is estimated to have a small but statistically significant association with the risk of hip and knee revision, but absolute numbers are small. Further studies are needed in order to distinguish between effects for specific revision surgery indications.