There is limited information about the relationship between diabetes mellitus (DM) and ALT to HDL-C ratio. This study aims to investigate this relationship for the first time in Iran. The data of this study were taken from the third phase of the Shahroud Eye Cohort Study, which was conducted in 2019 with the participation of 4394 people aged 50–74. ALT and HDL-C levels were measured using a BT-1500 autoanalyzer. The mean ALT/HDL-C ratio was reported along with 95% confidence intervals (CI). The multiple logistic regression was used to examine the association between this ratio and DM, while controlling for the effects of other independent variables. The mean and standard deviation of the ALT/HDL-C ratio in all participants were 16.62 ± 11.22 (95% CI 16.28–16.96). The prevalence of DM was 34.7% and individuals with DM had a mean ALT/HDL-C ratio that was 1.80 units higher than those without diabetes (P < 0.001). Also, in individuals with DM, the HDL-C was found to be 0.035 (mmol/L) lower (P < 0.001), while ALT was 1.13 (IU/L) higher (P < 0.001) compared to those without diabetes. Additionally, after controlling for confounding factors, the odds of developing DM increased in a non-linear manner with an increase in the ALT/HDL-C ratio. Abdominal obesity, advanced age, female gender, and hypertension were also found to be associated with increased odds of DM. In conclusion, an increase in the ALT/ HDL-C ratiowas associated with higher odds of DM. This ratio can serve as an important predictor for diabetes mellitus.