Background: Evaluating recovery after general anesthesia is vital to assess the success of anesthesia procedures. The quality of recovery-40 (QoR-40) questionnaire comprehensively measures post-anesthesia recovery. Poor postoperative pain management can lead to complications and chronic pain. Researchers studied ketamine because of its potential to enhance standard analgesics, improve pain control, and promote better recovery outcomes.Methods: This double-blind, randomized controlled trial involved 42 patients undergoing laparotomy at Haji General Hospital, Medan. Participants were randomized into two groups: one receiving fentanyl at 0.7 µg/kg body weight (BW) and the other receiving ketamine at 0.2 mg/kg BW. Consecutive sampling was used for participant selection, including patients who met specific inclusion and exclusion criteria. The QoR-40 questionnaire, validated in Indonesian, was administered postoperatively to assess recovery across five dimensions: comfort, feelings, support, independence, and pain.Results: The results of the study showed that the total QoR-40 score for fentanyl use had an average of 172.4762 + 3.81601, while in the group using ketamine, the average score was 174.7619 + 3.37498, which had a significant difference between the fentanyl group and the ketamine group with p <0.05.Conclusion: Ketamine provides a superior quality of recovery compared to fentanyl, as evidenced by higher comfort and total QoR-40 scores. These findings support ketamine's use as an effective alternative in anesthetic protocols for laparotomy procedures, promoting better recovery and reducing dependence on opioids.