In order to obtain an effective and reliable grain refiner for Mg-Al alloys, 1% (mass fraction) Mg3N2 was added into AZ31 Mg alloy. The microstructures of the Mg alloys were studied by optical microscopy, scan electron microscopy and X-ray energy dispersive spectroscopy, and the mechanical properties were determined. The results show that adding a small amount of Mg3N2 to AZ31 Mg alloy can refine the grain size from 103 to 58 μm. The ultimate tensile strength and elongation of AZ31 Mg alloy are 174.1MPa and 8.3%, respectively. After the addition of 1% Mg3N2, the ultimate tensile strength and elongation of AZ31 Mg alloy are increased up to 198.7 MPa and 11.8%, respectively. The grain refinement mechanism is that AlN is formed after Mg3N2 is added. Both AlN and Mg phases are of HCP lattice structure, and the disregistry between Mg phases and AlN along (0001)Mg//(0001)AlN is 3.04%, which is very effective for heterogeneous nucleation.