In an attempt to explore high efficient and low cost electrocatalyst in H-2 evolution reaction (HER), Mo2C nanoparticles with the size about 8 to 10nm are loaded on N, P co-doped mesoporous carbon matrix successfully with Na2MoO4 and carbonated beverage as precursors. The obtained electrocatalyst, Mo2C@NPC, possesses small dimension with the size about 200 to 300nm. Mo2C@NPC exhibits very excellent HER activity. It exhibits excellent electrocatalytic performance in basic condition, with overpotential 60mV and Tafel slope 63mVdec(-1) to get 10mAcm(-2) current density for H-2 evolution reaction (HER). To realize overall H2O splitting, Co was doped into Mo2C@NPC and a new electrocatalyst, named as Co/Mo2C@NPC was obtained. Co/Mo2C@NPC shows outstanding oxygen evolution reaction (OER) performance. Under same condition, to get current with density of 10mAcm(-2), Co/Mo2C@NPC merely need 360mV. The electrocatalyst also possesses excellent durability, after 1000 cycles as well as 10h long-term HER and OER tests, the current keeps stable. To achieve overall H2O splitting, an electrolyzer is constructed with Mo2C@NPC and Co/Mo2C@NPC as cathode and anode. To get a current with density 10mAcm(-2), it only needs a voltage of 1.60V. We expect Mo2C@NPC and Co/Mo2C@NPC electrocatalyst can act as a new material for overall H2O splitting.