The invention discloses a preparation method of a nitrogen-doped ordered mesoporous carbon material. The preparation method comprises the following steps: performing polymerization reaction on 2,4,6-trichloro-1,3,5-triazine and a polyamine compound in an organic solvent, adding an acid-binding agent to neutralize acid generated during polymerization reaction, so as to promote the polymerization reaction; filtering and drying to obtain a carbon-nitrogen material precursor, and performing high-temperature carbonization under inert atmosphere; cooling to room temperature, removing a template agent by utilizing hydrofluoric acid, to obtain the nitrogen-doped ordered mesoporous carbon material. The polymerization process of the precursor is simple and easily controlled and safe, the nitrogen-doped ordered mesoporous carbon material is good in the integration with a template, the porous structure is controllable, the cost is low, and the equipment is simple and convenient in requirement. The method is high in repeatability, and high in reaction yield; the product is good in uniformity, high in nitrogen content, and regular in structure; the whole process is simple and convenient. The prepared nitrogen-doped ordered mesoporous carbon material has porous ducts with ordered heights, large in specific surface area, the apertures are uniformly distributed, and the nitrogen-doped ordered mesoporous carbon material is high in stability, and has wide application prospects in the field of catalytic and electrode materials, and the like.