Nefopam is a centrally acting non-opioid analgesic, and its efficacy in multimodal analgesia has been reported. This study aimed to assess the analgesic efficacy of intraoperative nefopam on postoperative pain after video-assisted thoracoscopic surgery (VATS) for lung cancer. Participants were randomly assigned to either the nefopam or the control group. The nefopam group received 20 mg of nefopam after induction and 15 min before the end of surgery. The control group received saline. The primary outcome was cumulative opioid consumption during the 6 h postoperatively. Pain intensities, the time to first request for rescue analgesia, adverse events during the 72 h postoperatively, and the incidence of chronic pain 3 months after surgery were evaluated. Ninety-nine patients were included in the analysis. Total opioid consumption during the 6 h postoperatively was comparable between the groups (nefopam group [ = 50] vs. control group [ = 49], 19.8 [13.5-25.3] mg vs. 20.3 [13.9-27.0] mg; median difference: -1.55, 95% CI: -6.64 to 3.69; = 0.356). Pain intensity during the 72 h postoperatively and the incidence of chronic pain 3 months after surgery did not differ between the groups. Intraoperative nefopam did not decrease acute postoperative opioid consumption or pain intensity, nor did it reduce the incidence of chronic pain after VATS.