Herein, the authors explicitly reveal the dual-functions of N dopants in molybdenum disulfide (MoS2) catalyst through a combined experimental and first-principles approach. The authors achieve an economical, ecofriendly, and most efficient MoS2-based hydrogen evolution reaction (HER) catalyst of N-doped MoS2 nanosheets, exhibiting an onset overpotential of 35 mV, an overpotential of 121 mV at 100 mA cm−2 and a Tafel slope of 41 mV dec−1. The dual-functions of N dopants are (1) activating the HER catalytic activity of MoS2 S-edge and (2) enhancing the conductivity of MoS2 basal plane to promote rapid charge transfer. Comprehensive electrochemical measurements prove that both the amount of active HER sites and the conductivity of N-doped MoS2 increase as a result of doping N. Systematic first-principles calculations identify the active HER sites in N-doped MoS2 edges and also illustrate the conducting charges spreading over N-doped basal plane induced by strong Mo 3d–S 2p–N 2p hybridizations at Fermi level. The experimental and theoretical research on the efficient HER catalysis of N-doped MoS2 nanosheets possesses great potential for future sustainable hydrogen production via water electrolysis and will stimulate further development on nonmetal-doped MoS2 systems to bring about novel high-performance HER catalysts.