The invention relates to a method for preparing a heteroatom-doped carbon material at a room temperature. The method comprises the following steps: mixing a halogenated macromolecule and strong base with a strong polar solvent so as to obtain a mixture, grinding the mixture at the room temperature, and directly cleaning and drying after completion of grinding, so as to obtain the heteroatom-doped carbon material, wherein the halogenated macromolecule is polyvinylidene difluoride, polyvinylidene chloride or polyvinyl chloride, the strong base is alkali (earth) metal hydroxide, alkali (earth) metal alkoxide, alkali (earth) metal sulfide, alkali (earth) metal amides or alkali (earth) metal nitride, the strong polar solvent is N,N-dimethylformamide, N,N-dimethylacetamide, dimethyl sulfoxide or nitrogen methyl pyrrolidone and the room temperature refers to 10-40 DEG C. According to the method, the raw materials are cheap and easy to obtain, the operation is simple, safety is high and the method is very suitable for industrial expanded production.