Magnesium slag is a type of industrial solid waste produced during the production of magnesium metal. In order to gain a deeper understanding of the structure of magnesium slag, the composition and microstructure of magnesium slag were investigated by using characterization methods such as X-ray fluorescence, particle size analysis, X-ray diffraction, Fourier transform infrared spectroscopy and scanning electron microscopy. In addition, the state of Si occurrence in magnesium slag was analyzed using a solid-state nuclear magnetic resonance technique in comparison with granulated blast furnace slag. An inductively coupled plasma-optical emission spectrometer and scanning electron microscope with energy dispersive X-ray spectroscopy were used to characterize their cementitious behavior. The results show that the chemical composition of magnesium slag mainly includes 54.71% CaO, 28.66% SiO2 and 11.82% MgO, and the content of Al2O3 is much lower than that of granulated blast furnace slag. Compared to granulated blast furnace slag, magnesium slag has a larger relative bridging oxygen number and higher [SiO4] polymerization degree. The cementitious activity of magnesium slag is lower compared to that of granulated blast furnace slag, but it can replace part of the cement to obtain higher compressive strength. Maximum compressive strength can be obtained when the amount of magnesium slag replacing cement is 20%, where the 28-day compressive strength can be up to 45.48 MPa. This work provides a relatively comprehensive analysis of the structural characteristics and cementitious behavior of magnesium slag, which is conducive to the promotion of magnesium slag utilization.