Aims Antibiotic prophylaxis involving timely administration of appropriately dosed antibiotic is considered effective to reduce the risk of surgical site infection (SSI) after total hip and total knee arthroplasty (THA/TKA). Cephalosporins provide effective prophylaxis, although evidence regarding the optimal timing and dosage of prophylactic antibiotics is inconclusive. The aim of this study is to examine the association between cephalosporin prophylaxis dose, timing, and duration, and the risk of SSI after THA/TKA. Methods A prospective multicentre cohort study was undertaken in consenting adults with osteoarthritis undergoing elective primary TKA/THA at one of 19 high-volume Australian public/private hospitals. Data were collected prior to and for one-year post surgery. Logistic regression was undertaken to explore associations between dose, timing, and duration of cephalosporin prophylaxis and SSI. Data were analyzed for 1,838 participants. There were 264 SSI comprising 63 deep SSI (defined as requiring intravenous antibiotics, readmission, or reoperation) and 161 superficial SSI (defined as requiring oral antibiotics) experienced by 249 (13.6%) participants within 365 days of surgery. Results In adjusted modelling, factors associated with a significant reduction in any SSI and deep SSI included: correct weight-adjusted dose (any SSI; adjusted odds ratio (aOR) 0.68 (95% confidence interval (CI) 0.47 to 0.99); p = 0.045); commencing preoperative cephalosporin within 60 minutes (any SSI, aOR 0.56 (95% CI 0.36 to 0.89); p = 0.012; deep SSI, aOR 0.29 (95% CI 0.15 to 0.59); p < 0.001) or 60 minutes or longer prior to skin incision (aOR 0.35 (95% CI 0.17 to 0.70); p = 0.004; deep SSI, AOR 0.27 (95% CI 0.09 to 0.83); p = 0.022), compared to at or after skin incision. Other factors significantly associated with an increased risk of any SSI, but not deep SSI alone, were receiving a non-cephalosporin antibiotic preoperatively (aOR 1.35 (95% CI 1.01 to 1.81); p = 0.044) and changing cephalosporin dose (aOR 1.76 (95% CI 1.22 to 2.57); p = 0.002). There was no difference in risk of any or deep SSI between the duration of prophylaxis less than or in excess of 24 hours. Conclusion Ensuring adequate, weight-adjusted dosing and early, preoperative delivery of prophylactic antibiotics may reduce the risk of SSI in THA/TKA, whereas the duration of prophylaxis beyond 24 hours is unnecessary. Cite this article: Bone Jt Open 2022;3(3):252–260.