BackgroundLow levels of high-density lipoprotein cholesterol (HDL-C) and high levels of alanine aminotransferase (ALT) are related to insulin resistance, metabolic syndrome, and diabetes mellitus (DM). However, evidence on the connection between the alanine aminotransferase to high-density lipoprotein cholesterol (ALT/HDL-C) ratio and diabetes mellitus (DM) risk was limited. The study aimed to investigate the relationship between baseline ALT/HDL-C ratio and DM among Japanese individuals.MethodsThis second analysis was based on a cohort study using open-source data. Data from 15,342 individuals who participated in the medical examination program were recorded at Murakami Memorial Hospital in Japan between 2004 and 2015. Smooth curve fitting, subgroup analysis, Cox proportional-hazards regression, and a series of sensitivity analyses were conducted to examine the relationship between ALT/HDL-C ratio and incident diabetes. The ability of the ALT/HDL-C ratio to predict diabetes was evaluated using a receiver operating characteristic curve analysis.ResultsAfter controlling for confounding covariates, the ALT/HDL-C ratio was found to be positively correlated to the DM risk in Japanese adults (HR: 1.01, 95%CI: 1.00–1.02,P= 0.049). This study also found a stable relationship between ALT/HDL-C ratio and diabetes after employing a series of sensitivity analyses. Additionally, there was a non-linear association between the ALT/HDL-C ratio and incident diabetes, and the ALT/HDL-C ratio inflection point was 30.12. When the ALT/HDL-C ratio was below 30.12, the present study discovered a significant positive association between the ALT/HDL-C ratio and incident diabetes (HR: 1.04, 95%CI: 1.02–1.06,P= 0.001). Furthermore, among liver enzymes, blood lipids, and anthropometric indicators, the ALT/HDL-C ratio best predicts DM (AUC = 0.75, 95%CI: 0.73–0.78).ConclusionIncreased ALT/HDL-C ratio levels at baseline correlated to incident DM. The relationship between ALT/HDL-C ratio and incident DM was also non-linear. When the ALT/HDL-C ratio is below 30.12, there is a statistically significant positive correlation between the ALT/HDL-C ratio and incident DM.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12902-023-01382-7.