Objective To explore the relation between stress hyperglycemia ratio (SHR) and in⁃hospital death risk in patients with sepsis. Methods The clinical data of 1986 patients with sepsis who were firstly admitted to ICU were extracted from the critical care medical database Ⅳ (MIMIC⁃Ⅳ V2.2). Patients were assigned to survival group or death group according to patients' in⁃hospital death states. The Logistic regression model was established to explore the risk factors for in⁃hospital death in patients with sepsis. The prediction ability of SHR on prognosis of sepsis was evaluated by employing the receiver operating characteristic (ROC) curve. According to the factors in terms of gender, age, comorbidities, etc., a subgroup analysis was performed on the relation between SHR and in⁃hospital mortality, and then the interaction effect between SHR and stratification variables was further explored. Results A total of 305 patients were dead in hospital, with the incidence rate of death in 15.4%. The death group exhibited higher age, blood glucose at admission, SHR, proportion of patients without concomitant hypertension, infection and concomitant Sequential Organ Failure Assessment (SOFA) score, Simplified Acute Physiology System Ⅱ (SAPSⅡ) score, and longer mechanical ventilation duration, length of ICU stays as compared with the survival group (P<0.05). The results of multivariate Logistic regression analysis revealed that when SHR was elevated, in⁃hospital death risk of patients with sepsis was increased (P<0.05). Area under the curve of SHR combined with SAPSⅡ score for predicting in⁃hospital death of patients with sepsis was 0.667, which was higher than that of SHR single prediction (0.570, P<0.05). The results of subgroup analysis indicated that in the male subgroup, the female subgroup, age<65 years old subgroup, mechanical ventilation subgroup, SHR≥1.10 subgroup, non⁃administration of glucocorticoids subgroup, concomitant diabetes mellitus subgroup, non⁃concomitant diabetes mellitus subgroup, non⁃concomitant hypoglycemia subgroup, non⁃concomitant hypertension subgroup, non⁃concomitant heart failure subgroup, SHR elevation correlated with increased risk of in⁃hospital death in patients with sepsis (P<0.05). The results of interaction effect depicted that in concomitant and non⁃concomitant diabetes mellitus, concomitant and non⁃concomitant hypertension populations, there was a statistically significant difference in relation between SHR and in⁃hospital mortality in patients with sepsis (Pinteraction effect<0.05). Conclusion SHR elevation is closely related to increased risk of in⁃hospital death in patients with sepsis, and SHR elevation is the independent risk factor for affecting in⁃hospital death in patients with sepsis. The combination of SHR and SAPSⅡ score can preferably evaluate prognosis of patients with sepsis, exerting crucial reference values for clinical treatment and decision on patients with sepsis.