The release of heavy metals brings severe environmental pollution and affects product application during the pyrolysis of municipal solid waste. Due to the excellent immobilization properties, the utilization of pyrolytic char for heavy metals is a promising approach, yet the microscopic mechanism between Cl functional groups on the char surface and Pb/Cd species remains unclear. Thus, density functional theory was applied to study the interaction mechanism between them through geometric optimization, electronic structure, and chemical reaction. Owing to the strong valence electron hybridization, the Cl functional group greatly increases the adsorption stability of Pb and Cd species. In addition, the armchair edge of char exhibits better affinity to heavy metal (belonging to the chemisorption) than that of the zigzag edge, whose fixation stability follows the order of Pb0>PbCl2>CdCl2>Cd0. Compared with the chlorination by HCl, the Cl group raises the chlorination barrier of Pb0 and Cd0 over the zigzag edge, while there is no apparent tendency over the armchair edge, since it increases the energy barrier of Cd0 but lowers that of Pb0. Therefore, the Cl functional groups of char promote the fixation of Pb/Cd and inhibit the generation of the easily leachable CdCl2, thereby facilitating the in-situ immobilization of heavy metals.