The effect of vitamin D (VD) on the risk of preeclampsia (PE) is uncertain. Few of previous studies focused on the relationship between dietary VD intake and PE risk. Therefore, we conducted this 1:1 matched case–control study to explore the association of dietary VD intake and serum VD concentrations with PE risk in Chinese pregnant women. A total of 440 pairs of participants were recruited during March 2016 to June 2019. Dietary information was obtained using a seventy-eight-item semi-quantitative FFQ. Serum concentrations of 25(OH)D2 and 25(OH)D3 were measured by liquid chromatography–tandem MS. Multivariate conditional logistic regression was used to estimate OR and 95 % CI. Restricted cubic splines (RCS) were plotted to evaluate the dose–response relationship of dietary VD intake and serum VD concentrations with PE risk. Compared with the lowest quartile, the OR of the highest quartile were 0·45 (95 % CI 0·29, 0·71, Ptrend = 0·001) for VD dietary intake and 0·26 (95 % CI 0·11, 0·60, Ptrend = 0·003) for serum levels after adjusting for confounders. In addition, the RCS analysis suggested a reverse J-shaped relationship between dietary VD intake and PE risk (P-nonlinearity = 0·02). A similar association was also found between serum concentrations of total 25(OH)D and PE risk (P-nonlinearity = 0·02). In conclusion, this study provides evidence that higher dietary intake and serum levels of VD are associated with the lower risk of PE in Chinese pregnant women.