BackgroundStress hyperglycemia was positively associated with poor prognosis in individuals with acute myocardial infarction (AMI). However, admission glucose and stress hyperglycemia ratio (SHR) may not be the best indicator of stress hyperglycemia. We performed this study to evaluate the comparative prognostic value of different measures of hyperglycemia (fasting SHR, fasting plasma glucose [FPG], and hemoglobin A1c [HbA1c]) for in-hospital mortality in AMI patients with or without diabetes.MethodsIn this prospective, nationwide, multicenter China Acute Myocardial Infarction (CAMI) registry, 5,308 AMI patients including 2081 with diabetes and 3227 without diabetes were evaluated. Fasting SHR was calculated using the formula [(first FPG (mmol/l))/(1.59×HbA1c (%)-2.59)]. According to the quartiles of fasting SHR, FPG and HbA1c, diabetic and non-diabetic patients were divided into four groups, respectively. The primary endpoint was in-hospital mortality.ResultsOverall, 225 (4.2%) patients died during hospitalization. Individuals in quartile 4 had a significantly higher rate of in-hospital mortality compared with those in quartile 1 in diabetic cohort (9.7% vs. 2.0%; adjusted odds ratio [OR] 4.070, 95% CI 2.014–8.228) and nondiabetic cohort (8.8% vs. 2.2%; adjusted OR 2.976, 95% CI 1.695–5.224). Fasting SHR was also correlated with higher in-hospital mortality when treated as a continuous variable in diabetic and nondiabetic patients. Similar results were observed for FPG either as a continuous variable or a categorical variable. In addition, fasting SHR and FPG, rather than HbA1c, had a moderate predictive value for in-hospital mortality in patients with diabetes (areas under the curve [AUC] for fasting SHR: 0.702; FPG: 0.689) and without diabetes (AUC for fasting SHR: 0.690; FPG: 0.693). The AUC for fasting SHR was not significantly different from that of FPG in diabetic and nondiabetic patients. Moreover, adding fasting SHR or FPG to the original model led to a significant improvement in C-statistic regardless of diabetic status.ConclusionsThis study indicated that, in individuals with AMI, fasting SHR as well as FPG was strongly associated with in-hospital mortality regardless of glucose metabolism status. Fasting SHR and FPG might be considered as a useful marker for risk stratification in this population.Trial registration: ClinicalTrials.gov NCT01874691.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12933-023-01868-7.