Background Total knee arthroplasty (TKA) is a routine orthopedic procedure often associated with significant postoperative pain. Efficient pain management is paramount for patient recovery, with nonsteroidal anti-inflammatory drugs (NSAIDs) being a common choice. Nevertheless, the specific NSAID and its dosing regimen can have varying impacts on outcomes. Methods In this retrospective cohort study spanning from January 2016 to December 2020, we analyzed patients who underwent TKA. These patients were divided into two groups: one receiving preemptive low-dose ketorolac (15 mg) followed by 15 mg every 6 h for 48 h, and the other receiving parecoxib (40 mg) every 12 h for the same duration. We assessed pain scores, opioid consumption, and monitored adverse events. Results Our findings reveal that ketorolac yielded superior results compared to parecoxib. Specifically, patients receiving ketorolac reported significantly lower Visual Numeric Rating Scale (VNRS) scores at 8- and 20-h post-surgery. This trend was further confirmed by linear mixed models ( p = .0084). Additionally, ketorolac was associated with reduced opioid consumption during the initial 24 h. Importantly, the rates of adverse events were comparable between the two groups. Conclusion The utilization of preemptive low-dose ketorolac demonstrates promising potential in bolstering pain control within the initial 24 h post-TKA, potentially reducing the need for opioids. However, further exploration is required to thoroughly assess its prolonged analgesic effects and safety across various surgical contexts. These investigations could provide invaluable insights for optimizing pain management protocols.