The poor corrosion resistance of magnesium alloys is one of the main obstacles preventing their widespread usage. Due to the advantages of lower cost and simplicity in operation, chemical conversion coating has drawn considerable attention for its improvement of the corrosion resistance of magnesium alloys. In this study, a calcium phosphate coating was prepared on magnesium alloy AZ91D by chemical conversion. For the calcium phosphate coating, the effect of processing parameters on the microstructure and corrosion resistance was studied by scanning electron microscope (SEM) and electrochemical methods, and the coating composition was characterized by X-ray diffraction (XRD). The calcium phosphate coating was mainly composed of CaHPO4·2H2O (DCPD), with fewer cracks and pores. The coating with the leaf-like microstructure provided great corrosion resistance to the AZ91D substrate, and was obtained under the following conditions: 20 min, ambient temperature, and no stirring. At the same time, the role of NH4H2PO4 as the coating-forming agent and the acidifying agent in the conversion process was realized, and the formation mechanism of DCPD was discussed in detail in this work.