NaMg(H2O)2[BP2O8]·H2O was prepared by hydrothermal synthesis and was characterized by X-ray powder difraction and IR method. The title compound was synthesized from MgCl2·6H2O, NaBO3·4H2O, and (NH4)2HPO4 with variable molar ratios using hydrothermal method by heating at 165 °C for 3 days. The X-ray powder diffraction data was indexed in hexagonal system, the unit cell parameters were found to be as a = 9.428, c = 15.82 Å, Z = 4 and the space group is P6122. It is isostructural with MlMll(H2O)[BP2O8] type compounds where Ml = Na, K; Mll = Mg, Mn, Fe, Co, Ni and Zn. In addition NH4Mg(H2O)2[BP2O8]·H2O was also synthesized the first time in this research. Its unit cell parameters and hkl values were in good agreement with the sodium magnesium compound. The unit cell parameters are a = 9.529, c = 15.736 Å. The indexed X-ray powder diffraction data of both compounds which were not reported in the literature is presented in this work. The IR data of NaMg(H2O)2[BP2O8]·H2O is also reported.