Introduction In 2006, our provincial government initiated a program to reduce wait times for total hip or knee replacements by referring patients to a single tertiary-care centre. This program provided an opportunity to identify risk factors for perioperative complications as part of a continuing quality improvement project. We report the risk of postoperative urinary retention after hip and knee replacements and the risk factors associated with this complication. Methods After local Research Ethics Board approval, data were abstracted from charts of patients who underwent elective primary unilateral total hip or knee replacement surgery. The outcome was urinary retention in the first 24 hr after surgery. Risk factors were identified using multivariable logistic regression, and they were expressed as odds ratios (OR) or 95% confidence intervals (CI). Results From April 1, 2006 to May 31, 2007, 1,440 patients underwent 1,515 elective total hip replacement or total knee replacement. We abstracted data from 1,031 (71.3%) patients: mean age, 62 yr (interquartile range [IQR] 55-70); 53.7% female; 605 total hip replacements; and 426 total knee replacements. The procedures were performed under spinal (81.8%), general (10.2%), or combined spinal and general (8.0%) anesthesia. Patients spent 100 [IQR 90-114] min in the operating room and 3 [IQR 3-4] days in hospital. The 24-hr incidence of urinary retention was 43.3% (446/1031). Male sex (odds ratio [OR] 3.9; 95% CI 3.0 to 5.2), total hip replacement (OR 1.4; 95% CI 1.1 to 1.9), and intrathecal morphine were risk factors. Discussion Postoperative urinary retention is a common complication after total hip or total knee replacement, especially amongst men and patients receiving intrathecal morphine.