This retrospective cohort study investigated the association between in-hospital survival and two-dimensional (2D) echocardiography within 24 hours after the return of spontaneous circulation (ROSC) in patients who underwent in-hospital cardiopulmonary resuscitation (ICPR) after in-hospital cardiopulmonary arrest (IHCA). The 2D-echo and non-2D-echo groups comprised eligible patients who underwent transthoracic 2D echocardiography performed by the cardiology team within 24 hours after ROSC and those who did not, respectively. After propensity score (PS) matching, 142 and 284 patients in the 2D-echo and non-2D-echo groups, respectively, were included. A logistic regression analysis showed that the likelihood of in-hospital survival was 2.35-fold higher in the 2D-echo group than in the non-2D-echo group (P < 0.001). Regarding IHCA aetiology, in-hospital survival after cardiac arrest of a cardiac cause was 2.51-fold more likely in the 2D-echo group than in the non-2D-echo group (P < 0.001), with no significant inter-group difference in survival after cardiac arrest of a non-cardiac cause (P = 0.120). In this study, 2D echocardiography performed within 24 hours after ROSC was associated with better in-hospital survival outcomes for patients who underwent ICPR for IHCA with a cardiac aetiology. Thus, 2D echocardiography may be performed within 24 hours after ROSC in patients experiencing IHCA to enable better treatment.