Objective: There are conflicting reports on the relationship between vitamin D and periodontal disease. Our research is intended to further analyse the association between serum 25(OH)D3, a vitamin D precursor and periodontal disease based on a large national survey sample in Japan. Methods: We downloaded the 2009–2018 National Health and Nutrition Examination Survey (NHANES) cycle, which included a total of 23,324 samples. Logistic regression of factors influencing perioral disease including periodntal disease, and subgroup logistic regression were performed to analyse the relationship between serum vitamin D and perioral disease, using WTMEC2YR as weights for regression analysis. Then machine learning model–based prediction of perioral disease onset was performed, and the machine learning algorithms used included boost tree, artificial neural network, AdaBoost, and random forest. Results: We evaluated the vitamin D, age, sex, race, education, marriage, body mass index, ratio of family income to poverty (PIR), smoking, alcohol consumption, diabetes, and hypertension as variables in the included samples. Vitamin D was negatively associated with perioral disease; compared with Q1, the odds ratios and 95% CI were 0.8 (0.67–0.96) for Q2, 0.84 (0.71–1.00) for Q3, and 0.74 (0.6–0.92) for Q4 (P for trend <.05), respectively. The results of the subgroup analysis showed that the effect of 25(OH)D3 on periodontal disease was more pronounced in women younger than 60 years. Based on the accuracy and receiver operating characteristic curve, we concluded that a boost tree was a relatively good model to predict periodontal disease. Conclusions: Vitamin D might be a protective factor for periodontal disease, and boost tree analysis we emplyed was a relatively good model to predict perioral disease