The relationship between cancer and vitiligo has been explored but with inconsistent results. To examine the long-term cancer risk in vitiligo patients, we conducted a retrospective nationwide cohort study. From the National Health Insurance Research Database of Taiwan, a total of 13,824 vitiligo patients were identified and matched with 55,296 reference subjects without vitiligo by age, gender, and propensity score estimated by major comorbidities from 1997 to 2013. Demographic characteristics and comorbidities were compared between these two groups. Incidence rate ratios and hazard ratios (HRs) were calculated to examine cancer risks. The 16-year incidence rates of overall cancers were 621.06 (566.56–675.55) and 726.99 (697.24–756.74) per 100,000 person-years in the vitiligo and reference groups. Patients with vitiligo showed a significantly decreased risk of overall cancers [adjusted HR, 0.85; 95% confidence interval (CI), 0.77 to 0.93, p < 0.001] compared with reference subjects without vitiligo after adjusting for age, sex, comorbidities, and treatments. The risks of basal cell carcinoma (BCC) and squamous cell carcinoma (SCC) were significantly reduced (adjusted HR 0.21, 95% CI 0.11–0.38, p < 0.001), as well as internal malignancies (adjusted HR 0.89, 95% CI 0.81–0.99, p = 0.026). The results were consistent across different subgroups of patients, including male gender, ages more than 40 years, and those receiving long-term systemic disease-modifying antirheumatic drugs and phototherapies. Information related to phenotype, disease duration, vitiligo lesion sites, family history of vitiligo or cancer, occupation, and personal lifestyle was not included in the database. Vitiligo is associated with reduced risks of BCC and SCC, as well as internal malignancies.