The properties of hydroxyapatite can be improved by substitution of biologically relevant ions, such as magnesium (Mg) and strontium (Sr), into its structure. Previous work in the literature has not reached agreement as to site preferences in these substitutions, and there are suggestions that these may change with differing levels of substitution. The current work adopted a quantum mechanical approach based on density functional theory using the CRYSTAL09 code to investigate the structural changes relating to, and site preferences of, magnesium and strontium substitution (to 10 mol%) in hydroxyapatites and also to predict the corresponding vibrational spectra in the harmonic approximation. The structures underwent full geometrical optimisation within the P63 space group, indicating an energetic site preference for the Ca(2) site in the case of Mg substitution, and the Ca(1) site in the case of Sr. Shrinkage of the unit cell was observed in the case of Mg substitution, and expansion in the case of Sr substitution, in agreement with the corresponding ionic radii. Thermodynamic properties of the structures obtained from the harmonic vibrational frequency calculations confirmed that the structures were minima on the potential energy surface. Isotopic substitutions indicated that the main contribution of Sr and Mg to vibrational modes is at frequencies < 400 cm-1.