In this work, a magnesium phytic acid/hydroxyapatite composite coating was successfully prepared on AZ31 magnesium alloy substrate by chemical conversion deposition technology with the aim of improving its corrosion resistance and bioactivity. The influence of hydroxyapatite (HA) content on the microstructure and corrosion resistance of the coatings was investigated. The results showed that with the increase of HA content in phytic acid solution, the cracks on the surface of the coatings gradually reduced, which subsequently improved the corrosion resistance of these coated magnesium alloy. Electrochemical measurements in simulated body fluid (SBF) revealed that the composite coating with 45 wt.% HA addition exhibited superior surface integrity and significantly improved corrosion resistance compared with the single phytic acid conversion coating. The results of the immersion test in SBF showed that the composite coating could provide more effective protection for magnesium alloy substrate than that of the single phytic acid coating and showed good bioactivity. Magnesium phytic acid/hydroxyapatite composite, with the desired bioactivity, can be synthesized through chemical conversion deposition technology as protective coatings for surface modification of the biodegradable magnesium alloy implants. The design idea of the new type of biomaterial is belong to the concept of "third generation biomaterial". Corrosion behavior and bioactivity of coated magnesium alloy are the key issues during implantation. In this study, preparation and corrosion behavior of magnesium phytic acid/hydroxyapatite composite coatings on magnesium alloy were studied. The basic findings and significance of this paper are as follows: 1. A novel environmentally friendly, homogenous and crack-free magnesium phytic acid/hydroxyapatite composite coating was fabricated on AZ31 magnesium alloy via chemical conversion deposition technology with the aim of enhancing its corrosion resistance and bioactivity. The chemical conversion coatings, which are formed through the reaction between the substrate and the environment, have attracted increasing attention owing to the relative low treatment temperature, favorable bonding to substrate and simple implementation process. 2. With the increasing of hydroxyapatite (HA) content, the crack width in the composite coatings and the thickness of the coatings exhibit obviously decreased. The reason is probably that when adding HA into the phytic acid solution, the amount of active hydroxyl groups in the phytic acid are reduced via forming the coordination bond between P-OH groups from phytic acid and P-OH groups from the surface of HA, thus decreasing the coating thickness and hydrogen formation, as well as avoiding coating cracking. 3. By adjusting the HA content to 45 wt.%, a dense and relatively smooth composite coating with ~1.4 μm thickness is obtained on magnesium alloy, and exhibits high corrosion resistance and good bioactivity when compared with the single phytic acid conversion coating.