Background: Constipation is common in elderly inpatients with intracerebral hemorrhage. This study aimed to construct a model for predicting the risk of constipation in elderly inpatients with intracerebral hemorrhage and to provide reference for formulating targeted intervention measures. Methods: Elderly patients with intracerebral hemorrhage who were treated in the department of Neurosurgery of a third-class hospital in Suzhou from January 2018 to September 2023 were included. Clinical data of patients with and without constipation were compared. Logistic regression analysis was used to explore the influencing factors of constipation in elderly patients with intracerebral hemorrhage, and R software was used to construct a line chart model to verify its predictive effect. Results: A total of 504 elderly patients with intracerebral hemorrhage were included. The incidence of constipation in elderly patients with cerebral hemorrhage was 63.9%. Logistic regression analysis showed that GCS score (OR = 1.094, 95%CI: 1.019∼1.174), hypertension (OR = 2.911, 95%CI: 1.797∼4.715), use of dehydrating agent (OR = 3.794, 95%CI: 2.337∼6.158), surgical treatment (OR = 3.986, 95%CI: 2.339∼6.793), use of sedative drugs (OR = 4.212, 95%CI:2.386-7.435), and limb paralysis (OR = 6.313, 95%CI:3.689∼10.803) were the independent risk factors for constipation in elderly patients with intracerebral hemorrhage. The area under the ROC curve of the prediction model was 0.872 (95%CI: 0.8401∼0.9033), the best critical value was 0.705, the sensitivity was 0.748, and the specificity was 0.857. Conclusion: The constipation risk prediction model of elderly patients with cerebral hemorrhage has good differentiation and calibration, which is helpful for health care providers to identify the risk of constipation in elderly patients with intracerebral hemorrhage.