This study aims to investigate the association between the platelet-to-high-density lipoprotein cholesterol ratio (PHR) and diabetes/prediabetes in US adults. Data from the 2005–2018 National Health and Nutrition Examination Survey (NHANES) were analyzed in this study. The PHR was calculated by dividing platelet count by HDL-C concentration. Diabetes and prediabetes were classified according to established clinical criteria. Multivariate logistic regression analyses were employed to estimate odds ratios (ORs) and 95% CIs. We used a two-stage logistic regression model with restricted cubic splines (RCS) to evaluate potential non-linear relationships and to identify inflection points. The discriminative ability of the model was evaluated using receiver operating characteristic (ROC) curves, with the area under the curve (AUC) used to measure model performance. Sensitivity and specificity at the optimal threshold were also reported. Furthermore, subgroup and interaction analyses were conducted to determine variations across different population groups. The study included 20,229 eligible participants, with a mean age of 47.84 years, and 51.80% being female. Among the participants, 14.29% were diagnosed with diabetes, and 44.36% with prediabetes. A positive association was observed between PHR and diabetes/prediabetes. After adjusting for model 3, the OR for the combined outcome of diabetes and prediabetes associated with a per-unit increase in PHR was 1.17 (95% CI: 1.05–1.30). Participants in the highest PHR quartile had an OR of 2.55 (95% CI: 1.52–4.28) compared to those in the lowest quartile. Two-stage regression analysis identified a breakpoint at PHR = 4.55, with a positive association observed when PHR was below this value (OR = 1.33, 95% CI: 1.03–1.70). ROC analysis demonstrated good discriminatory ability of the model, with an AUC of 0.824 (95% CI: 0.803–0.845), sensitivity of 83.2%, and specificity of 66.5%. Stratified analyses revealed significant associations between PHR and diabetes/prediabetes across most demographic groups, with interactions observed for sex, alcohol consumption, and BMI, suggesting these factors may modify the association. This study suggests that an elevated PHR may be associated with a higher likelihood of diabetes and prediabetes. Consequently, PHR could serve as a valuable marker for estimating the association of diabetes and prediabetes development.