The effects of surface modification of CNF on their electrocatalytic activity for hydrogen evolution reaction (HER) were investigated. Firstly, Oxygen-containing functional groups were introduced onto the CNF surface (labeled as CNF-OX) by a simple sonochemical oxidation in mixed acids (concentrated sulfuric acid and nitric acid) and then the nitrogen-containing functional groups were introduced onto the CNF-OX surface (labeled as CNF-ON) by sonochemical treatment in ammonia, and the B-doped CNF was synthesized by mixing CNF-OX and boric acid in a ratio following by pyrolysis at 800 ℃ under N 2 atmosphere (labeled as B-CNF-OX). The XPS results showed that the ultrasonic treatments could introduce oxygen-and nitrogen-containing functional groups onto the CNF surface successfully, the oxygen atoms content of CNF-OX was increased from 1.96% to 6.01% compared to the untreated CNF (CNF-UN), and nitrogen atoms content of CNF-ON was increased from 0% to 1.02% compared to CNF-OX. The pyrolysis of boric acid could introduce B element onto the CNF-OX surface where the B atoms content of B-CNF-OX was 1.00%. The linear sweep voltammetry (LSV) test results showed that the HER electrocatalytic activity of the modified CNFs were higher than CNF-UN, and among them CNF-ON had the highest electrocatalytic activities for HER than the others, the onset overpotential of CNF-ON was 344 mV, which shifted 240 mV positively compared to CNF-UN, and the electrocatalytic activity of B-CNF-OX was enhanced by B-doping treatment compared to CNF-OX. The Tafel test indicated CNF-ON had smallest Tafel slop of 154 mV/dec and largest exchange current density of 6.68 μA/cm 2 . The electrochemical impedance spectroscopy (EIS) was carried out to investigate the complex interfacial properties of the CNFs modified electrode, and the results showed that CNF-ON had the smallest charge transfer resistance of 1578 Ω among all the catalysts, which means the nitrogen-doped CNF had higher activity than the oxygen-and boron-doped CNF. All above indicated that the doping of heteroatom (O, B, N) onto the CNFs surface had effects on their electrocatalytic activity for HER, especially the introduction of N atom onto the CNF surface had excellent improvement.