Vitamin D has been linked to cancer development in both pre‐clinical and epidemiological studies. Our study examines the association between serum levels of vitamin D and cancer incidence in the Capital Region of Denmark. Individuals who had vitamin D analyzed at The Copenhagen General Practitioners Laboratory between April 2004 and January 2010 were linked to Danish registries with end of follow‐up date at Dec 31st 2014, excluding individuals with pre‐existing cancer. Cox regression models adjusted for age in one‐year intervals, sex, month of sampling, and Charlson Comorbidity Index were applied. The study population of 217,244 individuals had a median vitamin D level of 46 nmol/L (IQR 27–67 nmol/L). Non‐melanoma skin cancer was the most frequent form of cancer, followed by breast‐, lung‐, and prostate cancers. No associations were found between increments of 10 nmol/L vitamin D and incidence of breast, colorectal, urinary, ovary or corpus uteri cancer. However, higher levels of vitamin D were associated with higher incidence of non‐melanoma (HR 1.09 [1.09–1.1]) and melanoma skin cancer (HR 1.1 [1.08–1.13]) as well as prostate (HR 1.05 [1.03–1.07]) and hematological cancers (HR 1.03 [1.01–1.06]), but with lower incidence of lung cancer (HR 0.95 [0.93–0.97]). In our study, vitamin D levels are not associated with the incidence of several major cancer types, but higher levels are significantly associated with a higher incidence of skin, prostate, and hematological cancers as well as a lower incidence of lung cancer. These results do not support an overall protective effect against cancer by vitamin D.