An electrochemical sensor based on carbon quantum dots (CQDs) and zeolitic imidazolate framework-8 (ZIF-8) composite was fabricated to detect lead(II). The CQDs (2.47 ± 0.52 nm) were synthesized from platanus acerifoli leaves by carbonization and the hydrothermal method. Under the optimal conditions, the fabricated electrochemical sensor had excellent performance in detecting Pb2+. The linear range for Pb2+was 1 nM–1 μM, and the limit of detection (LOD) was 0.04 nM and the limit of quantification (LOQ) was 0.14 nM. Moreover, when the solution contained Pb2+and Cd2+, the linear range for Pb2+was 50 nM to 1 μM and the LOD was 0.02 nM. When the solution contained Pb2+and Cu2+, the linear range for Pb2+was 50 nM–750 nM and LOD was 0.07 nM. Furthermore, even if the solution contained Pb2+, Cd2+and Cu2+, the linear range for Pb2+was 50 nM–1 μM and the LOD was 0.04 nM. The X-ray photoelectron spectroscopy (XPS), Fourier transform infrared spectrometer (FTIR) and Brunauer-Emmet-Teller (BET) results indicated that the composite electrode materials had abundant oxygen-containing functional groups, a large specific surface area and pore structure, which are conducive to the adsorption of heavy metal ions and improve the detection performance.