The objective of this study was to estimate the relationship between serum vitamin D (VitD) status and tuberculosis (TB) infection conversion (TBIC), measured by the tuberculin skin test (TST) and an interferon-gamma release assay, the QuantiFERON-TB Gold In-Tube (QFT-GIT) test, in the contacts of pulmonary TB patients in Castellon (Spain) in a prospective cohort study from 2010 to 2012. Initially, the participants were negative to latent TB infection after a screening that included TST and QFT-GIT tests, and other examinations. A baseline determination of 25-hydroxyvitamin D [25(OH)D] was obtained by chemiluminescence immunoassay. After 8–10 weeks, participants were screened for a second time to determine TB infection conversion (TBIC). Poisson regression models were used in the statistical analysis. Of the 247 participants in the cohort, 198 (80·2%) were screened twice and 18 (9·1%) were TBIC cases. The means of VitD concentration in the TBIC cases and the non-cases were 20·7±11·9 and 27·2±11·4 ng/ml (P = 0·028), respectively. Adjusted for high exposure and TB sputum acid-fast bacilli (AFB)-positive index case, higher serum VitD concentration was associated with low incidence of TBIC (Ptrend = 0·005), and an increase of 1 ng/ml VitD concentration decreased the incidence of TBIC by 6% (relative risk 0·94, 95% confidence interval 0·90–0·99, P = 0·015). The results suggest that sufficient VitD level could be a protective factor of TBIC.