ObjectiveThere have been proposals that vitamin D may be associated with a reduction in the incidence of anxiety disorders. However, the findings thus far have been inconsistent, warranting further investigation. The purpose of this paper is to explore the link between serum vitamin D and anxiety.MethodsData are from the National Health and Nutrition Examination Survey (NHANES) in the United States from 2007 to 2012. Study included a total of 12,232 participants, and through the multivariate logistic regression to study the relationship between serum vitamin D and anxiety, smooth curve fitting is used to study the nonlinear relationship between serum vitamin D levels and anxiety.ResultsSerum vitamin D levels demonstrated a negative correlation with anxiety (p < 0.001). Vitamin D exhibited a significant impact on anxiety (Q4:OR = 0.774, 95% CI: 0.663–0.903, p < 0.01), and this effect remained significant even after adjusting for confounding variables (Q4:OR = 0.781, 95% CI: 0.669–0.912, p < 0.01). Smoothed curve fitting revealed a negative association between serum vitamin D levels and the risk of anxiety, and these findings persisted after accounting for confounding variables.ConclusionSerum vitamin D levels were inversely associated with anxiety risk in US adults. In the future, more accurate prospective studies are needed to confirm this result.