Abstract Poor corrosion resistance limits the application of magnesium alloys. Conversion coating is widely used to protect magnesium alloys because of easy operation and low cost. A novel conversion coating on die-cast AZ91D magnesium alloy containing barium salts was studied. The optimum concentrations of Ba(NO 3) 2, Mn(NO 3) 2 and NH 4H 2PO 4 are 25 g/L, 15 mL/L and 20 g/L, respectively, based on orthogonal test results. The treating time, solution temperature and pH value are settled to be 5–30 min, 50–70 °C and 2.35–3.0, respectively. The corrosion resistance of barium conversion coating is better than that of manganese-based phosphate conversion coating by immersion test. The coating is composed of Ba, P, O, Mg, Zn, Mn and Al by EDX analysis.