Vitamin D may play a role in prevention of keratinocyte cancer (KC), but observational studies examining the association between serum 25-hydroxy vitamin D concentration and KC are largely uninformative because sun exposure causes both KC and vitamin D production. There is scant evidence from clinical trials of supplementary vitamin D. To examine the effect of vitamin D supplementation on the risk of developing KC. We used data from the D-Health Trial, a randomized placebo-controlled trial of vitamin D supplementation (60 000 international units monthly for 5 years) among Australians aged ≥60 years. KC outcomes were captured through linkage to a national administrative dataset for those who consented (N = 20 334; 95%). We used negative binomial regression to analyse the incidence of KC excisions and the incidence of actinic lesions treated using cryotherapy or serial curettage, and flexible parametric survival models for analysis of time to first KC excision. Randomization to vitamin D supplementation did not reduce the incidence of KC lesions treated by excision [incidence rate ratio (IRR) 1·04; 95% confidence interval (CI) 0·98-1·11], the incidence of actinic lesions treated using other methods (IRR 1·01; 95% CI 0·95-1·08) or time to first histologically confirmed KC excision (hazard ratio 1·02; 95% CI 0·97-1·08). However, in subgroup analysis vitamin D increased the incidence of KC excisions in adults aged ≥ 70 years (IRR 1·13, 95% CI 1·04-1·23; P-value for interaction = 0·01). Vitamin D supplementation did not reduce the incidence of KC or other actinic lesions. What is already known about this topic? Laboratory studies have suggested possible protective effects of vitamin D on skin cancer. Observational studies investigating the association between vitamin D and risk of keratinocyte cancer are largely uninformative as ultraviolet radiation both causes skin cancer and is the primary source of vitamin D. The evidence from randomized controlled trials of vitamin D is limited and inconclusive. What does this study add? This population-based, randomized controlled trial suggests that supplementing older adults with a high monthly dose of vitamin D for 5 years does not affect the incidence of keratinocyte cancer.