Plasma Electrolytic Oxidation (PEO) is promising for the processing of biomaterials because it enables the production of surfaces with adjustable composition and structure. In this work, aimed at the improvement of the bioactivity of titanium, PEO has been used to grow calcium phosphide coatings on titanium substrates. The effects of the addition of magnesium acetate to the electrolytes on the composition of the coatings produced during 120 s on Ti disks using bipolar voltage pulses and solutions of calcium and magnesium acetates and sodium glycerophosphate as electrolytes have been studied. Scanning electron microscopy, X-ray energy dispersive spectroscopy, Rutherford backscattering spectroscopy, X-ray diffractometry with Rietveld refinement and profilometry were used to characterize the modified samples. Coatings composed of nearly 50 % of Mg-doped hydroxyapatite have been produced. In certain conditions up to 4% Mg can be incorporated into the coating without any observable significant structural modifications of the hydroxyapatite.