BackgroundThe incidence of thyroid nodules has increased significantly in recent years, and surgical removal is a common treatment. Postoperative sleep disturbance is still a serious problem in the current surgical environment. In this study, we explored whether intraoperative lidocaine infusion could improve the quality of sleep over 7 days and 30 days after surgery and postoperative recovery for patients undergoing thyroid surgery.MethodsSeventy patients who underwent thyroid surgery from October 2020 to June 2021 were randomly assigned to the lidocaine or the normal saline group, 35 cases in each group. Patients enrolled in this study were randomized to receive either system lidocaine (a bolus of 1.5 mg·kg− 1, followed by an infusion of 2 mg·kg− 1·h− 1until the end of the surgical procedure) or identical volumes and rates of normal saline. The primary endpoint was the Pittsburgh Sleep Quality Index (PSQI) scores. Secondary endpoints included intraoperative remifentanil consumption, whether there was a cough within 5 min after extubation and the cough scores, postoperative pain scores, the incidence of postoperative nausea and vomiting (PONV).ResultsTotally seventy cases were enrolled and eventually sixty-eight cases were analyzed. PSQI scores did not change significantly over time (F = 2.799,P= 0.069); also, there was no significant difference in PSQI scores between two groups in the entire 30 days follow-up period (F = 0.174,P= 0.678). Further, there was no interaction between the time points and the intervention (F = 0.649,P= 0.513). Similarly, intraoperative remifentanil consumption, the incidence of cough and postoperative pain scores, were comparable between the two groups (allP> 0.05); while patients in the lidocaine group showed significantly lower cough scores (P= 0.042) and lower incidence of PONV (P= 0.015).ConclusionsSystemic lidocaine infusion might not improve the sleep quality and reduce postoperative pain over 7 days or 30 days after the operation of patients who underwent thyroid surgery, but it can reduce postoperative complications and improve the quality of recovery. Furthermore, sleep quality of patients wasn’t impaired significantly in the entire 30 days follow-up period after thyroid surgery compared with baseline values.Trial registrationRegistered in the Chinese Clinical Trial Registry (http://www.chictr.org.cn, identifier: ChiCTR2000039764, date: 08/11/2020)Supplementary InformationThe online version contains supplementary material available at 10.1186/s12871-023-02109-w.