The invention discloses a preparation method for an iron-boron compound coating. An electrospark deposition process is adopted for preparation, and a used electrode is of a round-rod-shaped partially-hollow structure. An electrode material is a single phase Fe2B material, or a material composed of Fe2B and Fe3B, or a material composed of FeB and Fe2B. A prepared iron-boron compound in the coating obtained after electrospark deposition is conducted is Fe2B and Fe3B, or FeB and Fe2B or FeB, Fe2B and Fe3B, and furthermore, the coating contains a martensite phase with the weight fraction being smaller than 8%. Compared with a boriding process, the preparation method is easy to implement and environmentally friendly, and the prepared coating has the beneficial effects of being high in hardness, toughness, better in wear resistance and the like.