The invention discloses a preparation method of nitrogen-doped carbon nanofiber aerogel with inlaid molybdenum carbide particles. The preparation method comprises the following steps of immersing bacterial cellulose in deionized water for removing acid, then immersing the bacterial cellulose in an ammonium heptamolybdate aqueous solution, conducting absorption till saturation, and obtaining ammonium heptamolybdate / bacterial cellulose; freezing the ammonium heptamolybdate / bacterial cellulose with liquid nitrogen, then conducting drying in a freeze dryer, and obtaining bacterial cellulose aerogel hybridized with ammonium heptamolybdate; finally, placing the hydridized bacterial cellulose aerogel in a tube furnace, conducting high temperature pyrolysis, and obtaining the nitrogen-doped carbon nanofiber aerogel with the inlaid molybdenum carbide particles. According to the method, the ammonium heptamolybdate and the bacterial cellulose are combined for being applied to preparation of functional carbon nano-materials, the method has the advantages of being simple, low in price, green, environmentally friendly, easy to produce on a large-scale and the like, and the prepared nitrogen-doped carbon nanofiber aerogel with the inlaid molybdenum carbide particles can serve as a catalyst for electric hydrogen production.