The invention discloses a method for preparing a non-metallic element doped carbon coated metal nanoparticle magnetic composite. The method comprises the steps that water-soluble metal divalent salt, a cyanamide compound and a nitrogen or boron or sulfur containing non-metallic compound are added into a methanol solution to be mixed, dissolved, dried and ground, and obtained homogeneous-phase powder is subjected to roasting pyrolysis under the protection of inert gas; and a pyrolysis product is subjected to acid pickling, washing, drying and grinding, and a target product is obtained. According to the whole preparing process of the method, metal ion reduction, metal nanoparticle coating and doping of nitrogen / boron / sulfur and other non-metallic elements are achieved in one step. The composite prepared through the method is high in degree of graphitization, good in dispersity between particles and high in purity, and the preparing method has the advantages that the cost is low, the process is simple, and large-quantity synthesis can be easily achieved.