A double-blind randomized controlled trial compared the effectiveness of prophylactic oral trimethoprim/sulfamethoxazole (cotrimoxazole) to a placebo in preventing peritonitis in continuous ambulatory peritoneal dialysis (CAPD) patients. A daily trimethoprim/sulfamethoxazole dose of 160/800 mg gives a steady state dialysate concentration of 1.07/4.35 mg/L in the final dwell of each dosing interval. Identification of a 40% reduction in peritonitis probability with 80% statistical power and a type 1 error probability of 0.05 required 52 subjects per group. With stratification by previous peritonitis, 56 were allocated to cotrimoxazole and 49 to placebo. For cotrimoxazole there were five deaths and seven catheter losses. For placebo there were three deaths and nine catheter losses. There were 20 withdrawals from cotrimoxazole and 9 from the placebo group. With respect to time to peritonitis, there was no statistically significant difference between cotrimoxazole and placebo groups (p = 0.19). At 6 months, 64.1% of cotrimoxazole and 62.5% of placebo were peritonitis free; at 12 months 41.9% of cotrimoxazole and 35% of placebo were peritonitis free. There was no effect (p > 0.05) of age, sex, catheter care technique, spike or luer, or dialysate additives. Previous peritonitis increased the risk of peritonitis by 2.06 (95% CI, 3.61–1.18) while frequent (six weekly) extension tubing changes increased the risk of by 1.79, (95% CI, 3.04–1.02) when compared to six monthly changes. Cotrimoxazole appears ineffective in prevention of CAPD peritonitis.