In this study, we have investigated feasibility of remifentanil and sufentanil anesthesia in children with congenital heart disease surgery and its effects on cardiac function and serological parameters. For this purpose, a retrospective study was conducted on 120 children with congenital heart disease who underwent repair of ventricular septum or atrial septum in our hospital, specifically from January 2016 to January 2018, and 60 patients in each group were randomly divided into the control and treatment groups, respectively. The control group was anesthetized with sufentanil, and the treatment group was anesthetized with remifentanil. The heart function, serological indexes, and adverse reactions were observed and compared. We have observed that there was no significant difference in HR levels between these groups (
P
>
0.05
), but SDP and DBP values of the two groups were decreased after anesthetic induction (
P
<
0.05
). ACH, cortisol, and lactic acid in the treatment group were significantly lower than those in the control group, and the difference was statistically significant (
P
<
0.05
). The incidence of bradycardia, nausea and vomiting, hypotension, muscle rigidity, and respiratory depression in the treatment group was 16.67% lower than that in the control group (
P
<
0.05
). Remifentanil has less influence on hemodynamics and a better analgesic effect than fentanyl in inhibiting stress response in congenital heart surgery, which provides reference and basis for children congenital heart surgery.