This study presents the preparation of pure, Sr and Mg-doped hydroxyapatite (HAP) by precipitation. Sr-doped HAPs (SrHAPs) and Mg-doped HAPs (MgHAPs) were fabricated with Sr molar ratio of 2, 4, 6, 8, 12 % and Mg molar ratio of 2, 4 %, respectively. Ca(NO3)2, Sr(NO3)2, Mg(NO3)2, (NH4)2HPO4 were used as starting materials, the Ca/P molar ratio was kept 1.67 during every synthesis and a 900 °C heat treatment was conducted to enhance the crystallinity. All of the products were analyzed by XRD, SEM and EDX, moreover lattice parameters and crystallite size calculations were performed to prove the ion incorporation into the crystal structure. The HAP structure was maintained when 2 and 4 Sr and 2 Mg % were applied and EDX confirmed the Sr and Mg content in these samples. In all other cases, various Sr and Mg-containing phases (Sr0.13Ca2.87(PO4)2, Ca2P2O7, Mg0.29Ca2.71(PO4)2) were identified while the HAP structure disappeared. It was shown that lattice parameters and the unit cell volume of Sr-doped HAPs increased slightly compared to pure HAP due to the bigger radius of Sr 2+ than Ca 2+. As the ionic radius of Mg 2+ is smaller than Ca 2+ , we demonstrated the distortion in the unit cell. Crystallite sizes increased as the amount of Sr and Mg raised. SEM experiments demonstrated that ion incorporation had little influence on the morphology, i.e. pure, Sr or Mg-doped HAPs were mostly homogenous, constituted of strongly sintered nanometer sized grains. Antimicrobial tests indicated that SrHAP with 4 Sr % and MgHAP with 2 % Mg had positive effect on cell viability.