Abstract Zinc–nickel alloy coatings were electrodeposited on carbon steel substrates from the ammonium chloride bath at different temperatures. The composition, phase structure and morphology of these coatings were analyzed by energy dispersive spectrometer, X-ray diffractometer and scanning electron microscopy respectively. Chronopotentiometry and potentiostatic methods were also employed to analyze the possible causes of the composition and structure changes induced by deposition temperature. It has been shown that both normal and anomalous co-deposition of zinc and nickel could be realized by changing deposition temperature under galvanostatic conditions. The abrupt changes in the composition and phase structure of the zinc–nickel alloy coatings were observed when deposition temperature reached 60°C. The sharply decrease of current efficiency for zinc–nickel co-deposition was also observed when deposition temperature is higher than 40°C. Analysis of the partial current densities showed that the decrease of current efficiency with the rise of deposition temperature was due to the enhancement of the hydrogen evolution. It was also confirmed that the ennoblement of cathodic potential was the cause for the increase of nickel content in zinc–nickel alloy coatings as a result of deposition temperature rise. The good zinc–nickel alloy coatings with compact morphology and single γ phase could be obtained when the deposition temperature was fixed at 30–40°C.