Nitrogen-doped hollow carbon spheres (N-HCSs) were successfully fabricated using silica sphere as template and resorcinol-formaldehyde resin as carbon precursor. Scanning electron microscopy and transmission electron microscopy demonstrated that diameters and shell thickness of N-HCSs were 325 and 25 nm, respectively. The N-HCS modified gold electrode was used for the square wave anodic stripping voltammetry for the individual determination of trace heavy metal ions (HMIs) such as Pb2+, Cu2+, and Hg2+ in drinking water. Electrochemical properties of modified electrode were characterized by cyclic voltammetry and electrochemical impedance spectroscopy. Moreover, the supporting electrolytes, pH, deposition potential, and deposition time were carefully studied. The N-HCS modified electrode exhibited the detection limit of 15, 17, and 2.35 nM for Pb2+, Cu2+, and Hg2+, respectively, which are significantly lower than the guideline values for drinking water quality provided by the World Health Organization. The electrochemical measurement results showed that the N-HCS structures exhibited wonderful adsorption and capacitive properties toward HMIs and were found to be useful for the simultaneous and selective electrochemical detection. Most importantly, herein we discussed the two types of test for simultaneous detection of Pb2+ and Hg2+, under the optimum experimental conditions. The sensitivity of Hg2+ increased in the presence of concentration range of Pb2+. Thus, this study provides a reliable method for online detection of low concentration Hg2+ and robust alternatives for heavy metal sensors.