Background and purposeAbsolute hyperglycemia at admission has been shown to be associated with the development of cerebral edema (CED) after acute cerebral infarction. Stress hyperglycemia is a more objective reflection of hyperglycemic state than absolute hyperglycemia. However, studies on the associations between stress hyperglycemia and CED are limited. We aimed to explore the associations of stress hyperglycemia, measured by stress hyperglycemia ratio (SHR), with the development of CED and poor functional outcome of acute cerebral infarction.MethodsPatients with acute middle artery cerebral infarction admitted to the Department of Neurology, West China Hospital of Sichuan University, within 24 h of symptom onset from January 2017 to March 2021 were included. Stress hyperglycemia was assessed by the SHR: admission fasting plasma glucose (FPG)/hemoglobin A1c (HbA1c). The primary outcome was the degree of CED evaluated on brain image. The secondary outcomes were moderate-to-severe CED, poor functional outcome (modified Rankin Scale score > 2), and death at 90 days. The associations between the SHR and outcomes were assessed with multivariate logistic regression analyses. We further compared the predictive value of the SHR, admission random plasma glucose (RPG), and admission FPG for outcomes in the training dataset and validation dataset.Results638 patients were enrolled. Each 0.1-point increase in the SHR was independently associated with a 1.31-fold increased risk of a higher degree of CED [odds ratio (OR): 1.31 (95% confidence interval (CI): 1.20–1.42), P < 0.001]. The SHR was independently associated with moderate-to-severe CED [per 0.1-point increase: OR: 1.39 (95% CI: 1.24–1.57), P < 0.001], poor functional outcome [per 0.1-point increase: OR: 1.25 (95% CI: 1.12–1.40), P < 0.001], and death [per 0.1-point increase: OR: 1.13 (95% CI: 1.03–1.25), P < 0.05]. The predictive value of the SHR (as a continuous variable), exhibited by the area under the curve in receiver operating characteristic analysis, was higher than that of the RPG and FPG for moderate-to-severe CED and poor functional outcome (P < 0.05).ConclusionThe SHR is independently associated with the severity of CED, poor functional outcome, and death after acute cerebral infarction, and the SHR (as a continuous variable) has a better predictive value for moderate-to-severe CED and poor functional outcome than the RPG and FPG.