The hot corrosion behavior of the NiAl coating and the 5Hf-NiAl coating induced by mixed salt at 900 °C was investigated. Comparing with the NiAl coating, the 5Hf-NiAl coating exhibited superior hot corrosion resistance because the addition of Hf promoted the formation of protective oxide scale and reduced the growth rate of oxide scale. Therefore, internal sulfides were not present in the 5Hf-NiAl coating after hot corrosion for 140 h. Cr exhibited different distribution in the two coatings since the addition of Hf changed the hot corrosion process of the coating. Hf and Ti in the 5Hf-NiAl coating trapped and captured sulfur, preventing the penetration of sulfur into the coating. The hot corrosion mechanism of the two coating and the effects of Hf on this process were discussed in this work.