To optimize the pyrolysis process of municipal wastewater sludge for metal sorption, this study investigated the characteristics of the produced biochar under different heating conditions with particular interest in Pb(II) or Cr(VI) sorption. Results indicate that the biochar pyrolyzed at 400°C for 2h obtained the largest BET surface area and was rich of organic functional groups, owning the highest Pb(II) (at pH 5.0) and Cr(VI) (at pH 2.0) sorption capacity. The Pb sorption is dominated by the rate-limited chemical processes, and a longer residence during pyrolysis significantly reinforces its sorption bonds. The Cr(VI) sorption is highly pH-dependent, and the optimal occurs at pH 2, where the transformation of Cr(VI) to Cr(III) makes a significant contribution as confirmed by the XPS spectra. Similarly, a longer residence during pyrolysis also facilitates the Cr(VI) sorption in terms of capacity and affinity, likely due to the greater reducing potential of biochar.