Hydroxyapatite (HAp) with the chemical formula Ca 10 (PO 4 ) 6 (OH) 2 is an inorganic material that exhibits morphology and composition similar to those of human bone tissues, making it highly desirable for bone regeneration applications. As one of the most biocompatible materials currently in use, HAp has undergone numerous attempts to enhance its mechanical strength. This research focuses on investigating the influence of magnesium (Mg) incorporation on the structural and mechanical properties of synthesized magnesium-doped hydroxyapatite (MgHAp) samples. Apart from its biocompatibility, Mg possesses a density and elasticity comparable to those of human bone. Therefore, incorporating Mg into HAp can be pivotal for improving bone formation. Previous studies have not extensively explored the structural changes induced by Mg substitution in HAp, which motivated us to revisit this issue. Hydrothermal synthesis technique was used to synthesize MgHAp samples with varying molar concentrations (x = 0, 0.5, 1.0, and 1.5). Theoretical simulation of HAp and MgHAp for obtaining 3D structures has been done, and theoretical X-ray diffraction (XRD) data have been compared with the experimental XRD data. Rietveld analysis revealed the alteration and deviation of lattice parameters with an increase in the Mg content, which ultimately affect the structure as well the mechanical properties of prepared samples. The findings revealed an increase in compressive stress and fracture toughness as the Mg concentration in the composition increased. Furthermore, using a finite-element analysis technique and modeling of the mechanical testing data, the von Mises stress distribution and Young's modulus values were calculated, demonstrating the similarity of the prepared samples to human cortical bone. Biocompatibility assessments using NIH-3T3 fibroblast cells confirmed the biocompatible and bioactive nature of the synthesized samples. MgHAp exhibits great potential for biomedical applications in the dental, orthopedic, and tissue engineering research fields.