In this paper, hair, which is composed of 99% keratin and 1% other elements, is chosen as a carbon source for nitrogen-doped carbon nanomaterials. By hydrothermal treatment of hair in water without any additives, such as salts, acids, or bases, carbon nanospheres with a photoluminescent quantum yield of 24.8% have been prepared. When the excitation wavelength changes from 300 to 480 nm, the photoluminescent peak shifts from 422 (violet) to 520 nm (green). Fourier transform infrared and X-ray photoelectron spectroscopy spectra analysis shows the carbon nanospheres are functionalized with hydroxyl, amino, carbonyl, and carboxylic acid groups. The carbon nanospheres have been further used as a novel probe for label-free detection of Hg2+ ions. The method possesses high sensitivity and selectivity. The linear range for Hg2+ ions is 10 to 100 nM. Meanwhile, the detection can be easily accomplished with a one-step rapid operation. This sensing system has been successfully used for the analysis of river water samples.