The combination of molten salt synthesis of nanoparticles and electrophoretic deposition of them is a novel method for preparing transition metal boride coatings. Herein, TiB2 nanoparticles were synthesized in NaCl-KCl-AlF3 molten salts and they were electrophoretically deposited on the graphite substrate to form a TiB2 coating in the same molten bath. Through the borothermal reduction reaction in this molten system, TiB2 nanoparticles with a size ranging from 50 to 150 nm were produced. Then, via electrophoretic deposition the prepared TiB2 coating exhibited excellent corrosion resistance to liquid zinc. In the cell voltage of 1.0–1.4 V, the thickness of TiB2 coatings first increased, and then decreased with the rise of voltage and reached a peak value of 28 μm at 1.3 V. The coating prepared at 1.2 V exhibited optimal quality. At a cell voltage of 1.2 V, as the EPD duration increased from 1 to 10 min, the amount of TiB2 deposited on the graphite substrate was linearly related to the total charge consumption, corresponding to 16.6 C for 1 mg of TiB2 deposition. This study offered fundamental guidance for preparing high-quality coatings through the molten salt synthesis and electrophoretic deposition process.