This study examines the possible association between urinary tract infection (UTI) and urinary tract cancer (UTC). Data from the National Health Insurance system of Taiwan were used for the analysis. The UTI cohort included 70 116 patients who were diagnosed and recruited between 1997 and 2010. Each patient was randomly frequency-matched with two people without UTI from the general population based on their age, sex, and month of UTI diagnosis. Cox's proportional hazard regression analysis was used to estimate the effects of UTI on UTC risk until the end of follow-up on December 31, 2010. Patients with UTI had a significantly higher risk of developing UTC than healthy people (adjusted hazard ratio, 4.66; 95% confidence interval, 3.55–6.10). Further analyses indicated that risks are potentially related to the level of the lesion site. This study indicated that patients with UTI had a higher risk of developing UTC.