BackgroundThe importance of preoperative urinary tract infection (UTI) in total hip and knee arthroplasty (THA and TKA) is controversial. The purpose of this study was to investigate the timing of preoperative UTI diagnosis and association with prosthetic joint infection (PJI) and determine if antibiotics impact this risk. MethodsA national database was used to analyze patients undergoing THA and TKA diagnosed with a preoperative UTI. Timing of diagnosis was categorized by 1-week intervals prior to surgery. Matched cohorts without UTI were collected, and PJI rates within 2 years of surgery were compared. Patients who received antibiotic prescriptions were identified and compared to no prescription. ResultsPreoperative UTI within 1 week of TKA was associated with higher rates of PJI (odds ratio [OR] 1.34, 95% confidence interval [CI] 1.26-1.43, P < .001). Preoperative UTI within 1 week of THA (OR 1.56, 95% CI 1.44-1.68, P < .001) and between 1-2 weeks prior to THA (OR 1.12, 95% CI 1.02-1.22, P = .022) was associated with significantly higher rates of PJI. UTI diagnosis at any other time interval did not reach statistical significance. Antibiotic prescription was not associated with lower rates of PJI. ConclusionPatients with preoperative UTI within 1 week of TKA or within 2 weeks of THA have an increased risk of postoperative PJI. Antibiotics do not appear to mitigate risk. Level of evidenceLevel III; Retrospective, database comparison.