To investigate the association between the visceral adiposity index and the prevalence of diabetes and prediabetes in the US adult population. We conducted a cross-sectional study using data from the National Health and Nutrition Examination Survey (NHANES) from 1999 to 2018 for ten consecutive years, including 18745 eligible participants. The weighted multivariate logistic model and fitting curve were used to explore the correlation and dose-response relationship between visceral adiposity index (VAI) and diabetes (DM) and prediabetes in the general population and the prevalence of different subgroups. In the fully adjusted continuous model, the risk of diabetes and prediabetes in the general population increased 0.15 times [1.15 (1.10,1.20), p<0.0001] with every increase of 1 unit of VAI. In the fully adjusted classification model, with the lowest quartile array Q1 of VAI as the reference group, Q2 of the second Quantile group, Q3 of the third Quantile group, and Q4 of the Quartile group increased 0.26 times [1.26 (1.10,1.44), p<0.001], 0.65 times [1.65 (1.43,1.89), p<0.0001], 1.60 times [2.60 (2.28,2.97), p<0.0001] respectively with the risk of diabetes and prediabetes. The above results showed that VAI was positively associated with the prevalence of diabetes and prediabetes, and the fitted curves showed a non-linear trend. (P for non-linear = 0<0.05). The results of the subgroup population were consistent with the total population and a significant interaction was found in gender (P for interaction<0.0001). In conclusion, we found a non-linear positive association between VAI and the risk of diabetes and prediabetes in the US adult population and found that women have a higher risk of diabetes and prediabetes than men; therefore, we should focus on the female population, and we call for the use of VAI to manage the development of diabetes and prediabetes in the clinical setting.