For ossification of the posterior longitudinal ligament (OPLL) and cervical spondylotic myelopathy (CSM), anterior decompression with fusion (ADF) can accurately achieve spinal decompression. However, the difference in perioperative complications in ADF between OPLL and CSM is poorly described. This study aimed to investigate the perioperative complication rates of patients with degenerative cervical myelopathy undergoing ADF, represented by OPLL and CSM, using a large national inpatient database. In the OPLL and CSM groups, postoperative complication (systemic and local) rates, reoperation rates, medical costs during hospitalization, and mortality after propensity score matching were compared. After matching, 1197 matched pairs were made. The incidence of total systemic complications was similar between both groups (OPLL, 12.4%; CSM, 12.2%). In the OPLL group, more perioperative local complications (cerebrospinal fluid leakage: CSFL, [OPLL, 2.7%; CSM, 0.3%] and surgical site infection: SSI [OPLL, 2.1%; CSM, 0.9%]) were detected, and the hospitalization cost was approximately $3200 higher than that in the CSM group. Moreover, medical costs were significantly higher in patients who experienced complications in both OPLL and CSM. The frequency of perioperative complications of OPLL and CSM in ADF was detailed using large real-world data. Compared to CSM, OPLL had more perioperative complications such as CSFL and SSI, and higher medical costs. Regardless of the disease, medical costs were significantly increased when perioperative complications occurred.