Objective To compare the clinical effect of posterior transforaminal endoscopic thoracic vertebral canal decompression versus posterior thoracic laminectomy in the treatment of thoracic ossification of the ligamentum flavum (OLF). Methods A retrospective analysis was performed on the clinical data of 58 patients with single-segment thoracic OLF who underwent vertebral canal decompression. According to different surgical procedures, the patients were divided into an endoscopic group (posterior transforaminal endoscopic thoracic vertebral canal decompression) and an open group (posterior thoracic laminectomy), with 29 cases in each group. Perioperative indicators (operation time, intraoperative blood loss, time to postoperative ambulation, incision length, length of hospital stay) and the occurrence of complications were compared between the two groups. Pain severity (visual analogue scale [VAS] score) and neurological function improvement (Japanese Orthopaedic Association [JOA] score) were compared before surgery and at 6 months postoperatively, while the Cobb angle at the decompressed segments and sagittal diameter of the vertebral canal were compared between the two groups at 6 months after surgery. Results The operation time, intraoperative blood loss, incision length, time to postoperative ambulation and the length of hospital stay were shorter or less in the endoscopic group than in the open group (P<0.05). Before surgery, there were no statistically significant differences in pain VAS score and JOA score between the two groups (P>0.05). At 6 months postoperatively, the pain VAS scores in both groups were significantly decreased compared with preoperative baseline, and the score in the endoscopic group was lower than that in the open group (P<0.05); the JOA scores in both groups were increased compared with preoperative baseline (P<0.05), but there was no statistically significant difference between the two groups (P>0.05). Before surgery, there were no statistically significant differences in the Cobb angle at the decompressed segments and sagittal diameter of the vertebral canal between the two groups (P>0.05). At 6 months postoperatively, there were no statistically significant differences in the Cobb angle at the decompressed segments in either group compared with preoperative values (P>0.05), while the sagittal diameter of the vertebral canal was significantly increased in both groups (P<0.05). The overall perioperative complication rate was higher in the open group than in the endoscopic group (P<0.05). Conclusion Compared with posterior thoracic laminectomy, posterior transforaminal endoscopic thoracic vertebral canal decompression for single-segment thoracic OLF can reduce the injury to surrounding tissues and the occurrence of preoperative complications, and is more conducive to postoperative rehabilitation. It is a minimally invasive, safe and effective method.